Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of decimal places
Message
De
03/10/2010 03:22:39
 
 
À
02/10/2010 11:24:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01483618
Message ID:
01483691
Vues:
113
This message has been marked as the solution to the initial question of the thread.
>I'm sure there is an obvious answer but it's the weekend ...
>
>Given a numeric variable which may or may not have digits after the decimal point, what would be the quickest way to know the number of digits that occur after decimal point, zero or more?

quickest
=MAX(LEN(CAST(m.Number % 1 AS M))-2,0)

* significant decimals only

=MAX(LEN(RTRIM(CAST(m.Number % 1 AS M),"0"))-2,0)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform