Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get decimal portion
Message
 
À
13/05/2007 04:07:09
Reza Meamar
Homa Programming Group
Shiraz, Iran
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 7 SP1
Divers
Thread ID:
01225039
Message ID:
01225313
Vues:
15
>I want to get 23 from 987.230 value.
>Is any function for this?
>Thanks

Hi Reza
May be
CLEAR
SET POINT TO [.]

lnNumber = 987.230
lnMed  = RTRIM(TRANSFORM(ABS(ROUND((lnNumber - INT(lnNumber))*1000000000,0))),0,"0")
? LTRIM(lnMed,0,"0",".")

?

lnNumber = -987.230
lnMed  = RTRIM(TRANSFORM(ABS(ROUND((lnNumber - INT(lnNumber))*1000000000,0))),0,"0")
? LTRIM(lnMed,0,"0",".")

? 

lnNumber = 7612.9876543
lnMed  = RTRIM(TRANSFORM(ABS(ROUND((lnNumber - INT(lnNumber))*1000000000,0))),0,"0")
? LTRIM(lnMed,0,"0",".")

? 

lnNumber = 2.123456789000
lnMed  = RTRIM(TRANSFORM(ABS(ROUND((lnNumber - INT(lnNumber))*1000000000,0))),0,"0")
? LTRIM(lnMed,0,"0",".")
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform