Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to format a currency fields ?
Message
 
À
29/11/1999 07:11:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00294286
Message ID:
00298208
Vues:
29
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform