Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Geting the decimal part of a number
Message
De
03/09/2004 16:49:36
 
 
À
03/09/2004 16:44:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00939304
Message ID:
00939324
Vues:
15
>what would you do if x = 89.555 and at run-time you don't know how many digits are after the '.' .
>
>>Would something like this work for you ?
>>
>>x = 89.55
>>y = INT(val(RIGHT(ALLTRIM(STR(x,50,2)),2)))
cDecStr = TRANSFORM(x-INT(x))
? SUBSTR(CHRTRAN(cDecStr,CHRTRAN(cDecStr,"0123456789",""),""),2)
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform