Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Double vs Numeric
Message
From
20/03/2012 14:41:01
 
 
To
20/03/2012 06:48:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01538640
Message ID:
01538814
Views:
51
>>>...I found a "gotcha" with currency which is calculations with currency field type cause type problems which require CAST() to convert. ...
>>
>>I personally experienced that, unfortunately. :(
>>I needed make some multiplication calculations with currency fields and got "too big value" error and had to convert with cast.
>>
>>Use double or numeric.
>
>Yes, I went with double. They work fine for my purposes. You start to lose decimals when the number exceeds 12 digits to the left of the point, but for my data the numbers which are this large do not have a decimal part anyway. So I can use the double for this job.

On VFP doesn't exist a true Numeric values, when VFP uses a numeric field, convert the numeric value to a double value.
CREATE CURSOR AA (FN N(18))
INSERT INTO AA VALUES (9999999999923457)
CLEAR
? AA.FN=AA.FN+1
? TRANSFORM(AA.FN,"@R 99999999999999999999")
replace AA.FN WITH AA.FN+1
? TRANSFORM(AA.FN,"@R 99999999999999999999")
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform