I have this in my view model:
[Required(ErrorMessage = "Price is required")]
[Range(0.01, 999999999, ErrorMessage = "Price must be greater than 0.00")]
[DisplayName("Price ($)")]
public decimal Price { get; set; }
I'd like to validate that the user doesn't enter more than 2 decimal places. So I'd like to have
Valid values: 12, 12.3, 12.34
Invalid values: 12., 12.345
Is there a way to validate this with a data annotation?