Information générale
Catégorie:
Codage, syntaxe et commandes
>>Dumb question... I looked in help but couldn't find (it's too late a night!) how to convert a currency field to a character string, without it rounding up! A currency field (bucks) containing 399.75 becomes "400" if I STR(bucks) or STR(MTON(bucks)), I just want a string containing "399.75". What am I missing?
>
>If you use STR(), you need to specify the two optional parameters that specify the size and decimal precision of the resulting character string; the default is to return just the integer portions.
>
>Try STR(bucks,10,2) to get back a 10 character string with two decimals to the right of the decimal point. Note: you will get back ".00" this way when taking the STR() of an integer value.
If you are using VFP 6.0 try Transform( bucks )
Glenn
Fox Fever - Get it!
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement