I am using math.round()
to round off.
this is the code:
double value=0.145
Math.round( value* 100.0) / 100.0;
My expectation is it should return 0.15
but it is returning 0.14
.
Also, if the value is 0.055
, then it is returning 0.05
instead of 0.06
I have already gone through the link round up to 2 decimal places in java?
Please tell me specific that why this is happening?
Thanks in Advance.