Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rounding problem
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00681174
Message ID:
00681268
Views:
18
You need to set decimal to the desired accuracy.
For your example you need to set decimal to 11. Then you will see the very same result for both lines.
I believe, that the problem appears somehow because the round() ignores decimal settings.

>>It is rounding correctly. 1.3749 is less than 1.3750, so it is rounded down.
>
>OK, I'll accept that. Now, consider this equation:
>
15000000*.01721250*82/360
>This produces a result of 58809.375.
>
>However,
>
ROUND(15000000,3)*.01721250*82/360
>will produce 58809.37499999999
>
>Now, as far as I can see 15,000,000 is the exact same value in both equations because everything to the right of the decimal is zero. What is the explanation for the difference in results? This phenomenon does not happen on my calculator, nor does it happen in Excel. The reason I'm harping on this is because this is showing up in our interest calc/accounting application. Mutiply that problem by a whole lot of trades and you have a big accounting problem. :)
>
>Jon
Previous
Reply
Map
View

Click here to load this message in the networking platform