User1987415599 posted
Hi, Can anyone give me a work-around for this please?
If you have a classic ASP page with the following:
<% response.write 1.0668 - 1.01885 &"<br>" %>
This 'should' give you the answer of:
0.04795
but in reality gives:
4.79499999999999E-02
Through experimentation I can see that the issue relates to the number of decimal places in the second number AND that fact it ends in a five. (If I change that end number from a 5 to a 4 for example -it works it out correctly. Also, if I reduce
the number of decimal places in the second number (but still have it ending with a 5), again, it works out it correctly.
So the 'bug' appears to be related to a number with "at least" 5 decimal places ending in a 5.
I've tried the usual cdbl() and formatnumber() without any success.