Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for number of digits in a number
Message
De
26/12/2001 07:44:03
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00598086
Message ID:
00598125
Vues:
24
Hello Nadya.

>> I've checked old messages, but didn't find a solution for this problem: I need to find out the number of digits in a number. <<

Just to give you one more idea, if you have FoxTools loaded, you can use StrFilter() like so:

LEN( STRFILTER( TRANSFORM( MyNumericValue ), "0123456789" ) )

But this solution has the same limitation as the one Vlas suggested using CHRTRAN.

>> Say, I have 12.3456000 - the number of digits should be seven. <<

By my reckoning, there are 9 digits there if you include the trailing zero's. Or did you really mean the number of digits to the right of the decimal point? If this is the case, something like this should work:

LEN( GETWORDNUM( TRANSFORM( MyNumericValue ), 2, '.' ) )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform