Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Geting the decimal part of a number
Message
From
03/09/2004 16:49:36
 
 
To
03/09/2004 16:44:12
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00939304
Message ID:
00939324
Views:
13
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform