Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
When to choose currency data type?
Message
From
24/08/2009 09:22:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01419279
Message ID:
01420164
Views:
60
>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)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform