I have this in my view model:
[Required(ErrorMessage = \"Price is required\")] [Range(0.01, 999999999, ErrorMessage = \"Price must be greater than 0.00\")] [
[RegularExpression(@"^\d+.\d{0,2}$",ErrorMessage = "Price can't have more than 2 decimal places")] public decimal Price { get; set; }
This will cater for 0 to 2 decimal places, or none at all.