I'm having a bit of trouble doing the calculation in Java. Here is what I am trying to do -
((0.053800 * (500000/1000)) + 4) * 0.85
In my java application, it returns 26.264999999999997, which, if rounded to two decimal places, becomes 26.26.
But in MS Excel, the same formula returns 26.265000 .. and therefore the rounded result is 26.27.
If my Java application returns the wrong value, what can I do to fix it?
Silent walker
source share