Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Currency Field Type
Message
From
20/05/2004 22:26:59
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
20/05/2004 21:37:41
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00905874
Message ID:
00905885
Views:
13
This message has been marked as the solution to the initial question of the thread.
>I'm about to use the currency type in an important app. I seem to remember when this field type first came out that I had some problems with some commands like round(), or transform() or reporting layouts - I can't remember exactly. So....

I can give you a specific example - I got something similar.
round($1 * 5.12345, 3)
You expect: 5.123

You get: 5.124

Reason: First, the number is converted to currency, which is limited to 4 decimal places, that is, 5.1235. This is then rounded up to 5.124.

>
>Does anyone know of any "gotcha"s when using Y type compared to say N(12,2) ?

Mainly, if a calculations involves a currency value, ALMOST ANYWHERE, the entire result will be currency. If you need more decimals in some calculations, use mton() to convert to numeric.

If you know what you are doing, I don't really see any reason NOT to use Currency, when it makes sense. I have been using it for quite a while. Some workarounds, especially the use of mton(), are required here and there.
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