Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Finding position of decimal
Message
De
22/03/2001 14:24:11
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00487442
Message ID:
00487738
Vues:
11
? GetDecimals(1233456.778900000)
9
Function GetDecimals(pnNum)
Local lcNum, lnDot, lnRetVal

* pad to arbitrary size
lcNum = Alltrim(Padl(pnNum, 1000))
lnDot = at('.', y)

Return IIF(lnDot = 0, 0, Len(lcNum) - lnDot)
>How can I find the position of the decimal point in a numerical value. I tried to convert the number to string but it rounded the value.
>
>thanks
>Nick
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform