I created a ViewModel object that has a decimal field containing a price. When I post that to my controller, this is what happens:
- Enter "15" -> ok! Controller receives 15.
- Enter "15.00" -> not ok! Controller receives a 'null' field.
- Enter "15,00" -> validation error because the field should be formatted with a period (I just stick to one formatting type to avoid complexity for the time being).
- Enter "15.00M" -> validation error, probably because it's not considered to be a number.
How do I fix this? I want "15.00" to be a correct value, but I can't figure out how to do this. I tried a couple of custom modelbinders that I found on the interweb, but they didn't work.