Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to format a currency fields ?
Message
From
04/12/1999 09:44:40
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00294286
Message ID:
00298641
Views:
27
>The problem is NOT currency fields, it is when you do your rounding. For example, check the difference in these two sums;
>
>
>           Values    Not Rounded   Rounded
>            12.9999    12.9999       13.00
>            12.1190    12.1190       12.12
>            12.9958    12.9958       13.00
>            12.4998    12.4998       12.50
>            50.6145    50.6145       50.62
>Rounded to 2 decimals  50.61         50.62
>
>
>This short list of 4 values is off by .02, if we had 100,000 transactions then the differnece would be 2,000.

The theory says the roundoff errors don't exactly accumulate, they sort of nullify each other, so your total may not be total for 2,000, but somewhere in the range of 50-200, but then that's theory. I've had a case of bakery delivering same things to same shops day after day, so there were many repeated values, and the total roundoff error was huge (still pretty low - 3,00 to 5,00 on a monthly total of 90,000)... well, if you ask accountants, 0.01 is huge already.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform