Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Double vs Numeric
Message
From
20/03/2012 15:12:13
 
 
To
20/03/2012 14:41:01
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01538640
Message ID:
01538821
Views:
34
>>>>...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")
>
Interesting :) For my purposes the numbers are smaller and so I will not hit these problems. Thanks for the info.
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Reply
Map
View

Click here to load this message in the networking platform