Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to format a currency fields ?
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00294286
Message ID:
00298208
Views:
30
>I strongly advise NOT to use currency fields. I have used them and realized they don't work (at least not in my apps)
>I calculate interest for govenment bonds and they were hundreds of Dollars off.
>Changed the field type to N(17,2) and everything balances to the penny!
>
>(My 2 cents (numeric 10,2))
>
Peter,

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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform