Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determining the number of decimal places of a variable?
Message
De
02/03/2003 22:41:40
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00759689
Message ID:
00760216
Vues:
16
>Does anyone know of a way to determine the number of decimal places of a numeric variable or of a way to return the correct number of decimals as a String?
>
>I can't find a function to determine how many decimals are stored in the variable.

I tried this on a wild guess:
Create Cursor zz (l l)
Append Blank
n=33.23145000
Select m.n from zz into cursor nn
Display Structure
And the exp_1 field was n(19, 8). I tried with different values for n, with different number of decimals (including trailing zeros), and the size of the field was always n(10+d+1, d), d being the number of decimals of the number n.

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