Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get decimal portion
Message
 
To
13/05/2007 04:07:09
Reza Meamar
Homa Programming Group
Shiraz, Iran
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 7 SP1
Miscellaneous
Thread ID:
01225039
Message ID:
01225313
Views:
20
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform