Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why use a 'currency' type field?
Message
From
15/05/1999 06:33:49
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00217569
Message ID:
00219303
Views:
20
>>Dear VFP Mavens -
>>
>>I'm trying to understand why one would use a currency type field instead of a numeric. We have a situation which might require 5 decimal places and currency only goes to 4. I know there has to be an upside to currency vs. numeric ... could someone explain it to me?
>>
>>Thanks loads in advance!
>>
>>-- John Kiernan
>
>More places on the OTHER side of the decimal. Currency type is for big numbers. Also, the "new numeric" types are stored more efficiently than xBase Numeric type. They're actually stored as numbers, not ASCII representation of numbers.

Even more precisely, the currency type is stored as an 8-byte integer (AFAIK), which only gets divided or multiplied with 10000 as necessary to keep the phantom decimal poind in position, when these numbers are multiplied or divided. All other numbers in VFP are stored as IEEE numbers in memory, or as integer, float or ASCII representations in tables. This should provide vast speed in most of the arithmetics. Of course, if this arithmetics involves other numeric types, we're getting into conversions, which nullifies some of the speed gain.

back to same old

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

Click here to load this message in the networking platform