Hi. I want to be able to store specific number of decimals in a model. What I have is
public decimal Cota { get; set; }
but how do I allow storage of 112.45 and prevent 112.4543 for example? only two digits after the point
Hi. I want to be able to store specific number of decimals in a model. What I have is
public decimal Cota { get; set; }
but how do I allow storage of 112.45 and prevent 112.4543 for example? only two digits after the point
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishal YelvePosted Dec 1, 2022, 10:33 AM
Hi Marius,
Try this
Marius VasilePosted Dec 1, 2022, 10:40 AM
Thank you Vishal, that did the trick
Marius VasilePosted Dec 1, 2022, 10:26 AM
Thank you Amit, but 112.4543 was just an example. I meant any number with decimals but only 2 allowed
Amit MohantyPosted Dec 1, 2022, 10:21 AM
Try this