Forums Register Login

round up double numbers to desired value?

+Pie Number of slices to send: Send
Hi guys,

I have a double/big decimal value with 2 decimal places....What I want is that if decimal value is .01 - .49, it should round up to 0.50.
Then if decimal value is between 0.51 - 0.98, it will round up to 0.99.

Is there a function in double that can do this? How can I do this? TIA
+Pie Number of slices to send: Send
+Pie Number of slices to send: Send
There is no standard form of rounding which will give you those results. I think you will have to write your own algorithm.
a fool thinks himself to be wise, but a wise man knows himself to be a fool - shakespeare. foolish tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 375 times.
Similar Threads
Need a function that converts a double into a whole int, rounding the decimal and ret
Number formatting
fast method to round
how to convert double as a currency
BigDecimal() issue
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 22:50:04.