Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
INT()egering a Numeric type, expected value isn't correc
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00383077
Message ID:
00383220
Vues:
18
>>>>We have a field which is set as Numeric type say Amount N(10,4). Value of which was derived from different variables and fields (n1+n2+n3, etc.). Somewhere in the module, it is clear that Amount has a value of 16.0000 being shown in the debugger, but if we try to make use of INT(Amount), it gives us 15. Trying to do the same procedure in the command window but this time using variables, it produces the correct result. Is there a hidden anomaly of using a Numeric type?
>>>
>>>Jess,
>>>
>>>If n1 + n2 + n3 > 15.9994 then the value stored in the field will be 16.0000. INT(n1 + n2 + n3) = 15, but INT(amount) will be 16.
>>
>>Referring to what Cindy told me, Money is the way to go but that's in SQL Server, isn't it. Could Currency data type will fix the problem?
>
>Nope, it won't. The same thing will happen in the above situation I mentioned. While the Currency data type is supported it won't do anything different. You're going to have to either lengthen the field (for a numeric or float type) or use the double type with the number of decimals set to the appropriate value. All of these types are supported in VFP 6.0.

Yessiry! I hope we could fix this one because we are about to loss one big project because of the inconsistencies.
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform