Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to check decimal points
Message
De
14/06/2004 15:55:48
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00913595
Message ID:
00913601
Vues:
31
Hello Sergey and Ramil;
>>
>>Is there a way to know how many decimal places a current variable has?
>>
>>Example:
>>x=1.000
>>y=3.0
>>z=5.12004
>>* How to get the decimal places for each variable?
>>
>>
In addition of Sergey's aprouch
lnNumber = 1.000
lcStr = PADL(lnNumber,20)
IF AT(SET("POINT"), lcStr) = 0
  ? 0
ELSE
  ? LEN(SUBSTR(lcStr, AT(SET("POINT"), lcStr)+1))
ENDIF
For international issues..

Claudio
"Now to him who is able to do immeasurably more than all we ask or imagine, according to his power that is at work within us, Ephesians 3:20
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform