I have a decimal field that I receive back in a controller in C# MVC. I need to know if it's value in decimal has no more than three positions.
So 0.00 is accepted as well as 0.01, but 0.001 would be denied.
Doing this:
if (discount > 1 || discount< (decimal) 0.01)
{
// Log error
}
Only partially works since the 0.00 is denied. How could I do that?