Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Decimal precision is of a variable
Message
De
15/09/1998 10:25:33
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
14/09/1998 15:33:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00136301
Message ID:
00136721
Vues:
31
>Hi Craig (and Alvin)
>
>>>Is there a command that returns the decimal precision of a variable?
>>>
>>>Example a=1.00 is 2 decimal
>>> a=1 is 0
>>>
>>>TIA
>>
>>Look at SET DECIMALS.
>
>....And to check, try nVar = SET("DECIMALS"). nVar will be the precision.

Quote help:
"SET DECIMALS specifies the minimum number of decimal places used to display the results of division, multiplication, and trigonometric and financial functions.".
It's for display only, if you use ? nVar, or str(nVar). Just try

x=1.000000002
set decimals to 3
?x
set decimals to 8
?x

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform