I have this in my view model:
[Required(ErrorMessage = \"Price is required\")] [Range(0.01, 999999999, ErrorMessage = \"Price must be greater than 0.00\")] [
I had the same scenario as the OP, yet the answers provided don't give a solution that works for all of the following cases:
12, 12.3 and 12.34
To do that, we use the following regular expression:
[RegularExpression(@"^\d+(.\d{1,2})?$")]