Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When to choose currency data type?
Message
De
24/08/2009 09:22:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01419279
Message ID:
01420164
Vues:
59
>Hi Hilmar
>
>>"Is this good" depends on what results you expect. An accountant may expect 0.99; in this case, you have to round intermediate results, whether you use Currency or Double type. If you want the result to be closer to 1, Double will give you better results, since calculations are done with more decimals.
>
>I guess I will pass currency for the while. I have had to split an invoice, tax, etc. values into parts and those parts are then expected to sum back to the original whole. Thanks for the explanation.

Note that you can still STORE as Currency - i.e., use the Currency type in the database - and convert to numeric when required for calculations (with the mton() function). Storing as Currency may save space in some cases.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform