Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Currency data type, BUG or FEATURE?
Message
From
10/03/2006 13:50:23
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
10/03/2006 08:28:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01102959
Message ID:
01103212
Views:
15
This message has been marked as a message which has helped to the initial question of the thread.
>So are ther any advantages in using currency as a data type, instead numeric or double? Apart from output format with the currency sign?

Internally, a currency value is a 64-bit integer which just gets divided by 10000 when used. So any computation with it should be a lot faster than the usual IEEE format floating numbers. It's perfect for financial apps where you may have a long computation.

Other than that - you may need to check your computation for potential errors; when computing anything that includes division by numbers between -1 and 1 you may be better off by using regular IEEE numbers - they may not be as fast, but they maintain a 15 digits mantissa. If you're not sure when and where will VFP internally convert from currency to IEEE and back, you may consider using ntom() and mton() functions to enforce your own order.

BTW, just heard your new president on the radio. She surely sounds good.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform