Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Double vs Numeric
Message
De
20/03/2012 14:41:01
 
 
À
20/03/2012 06:48:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01538640
Message ID:
01538814
Vues:
49
>>>...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")
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform