My question may seem simple, but still can not get something that works. I need to customize the Math.round rounding format or something to make it work as follows:
If the number is 1.6 he should round to 1, if greater than or equal to 1.7 should round to 2.0 . And so to all other decimal results with # .6 The way I'm doing the 1.6 being rounded to 2 shall be rounded to 1.
How can I do that?
Thank you!
Simply do this:
double threshold = 0.7;
Math.round(x - threshold + 0.5);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With