I want to round decimal value digits to upper value if digit isn’t zero.
I want to round the 6th digit to upper value .
Sample Value = 1.0003331
Expected Value = 1.000334
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sounds like you might want:
(The scale may be off by one 🙂
Obviously this will cause a problem if you try to handle very large numbers with it – they could overflow.
I’d like to think you could also do the same thing by adding a certain amount and then using
decimal.Round, but it’s slightly awkward without aMidpointRoundingofRoundTowardsZero.