Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding position of decimal
Message
From
22/03/2001 14:24:11
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00487442
Message ID:
00487738
Views:
12
? GetDecimals(1233456.778900000)
9
Function GetDecimals(pnNum)
Local lcNum, lnDot, lnRetVal

* pad to arbitrary size
lcNum = Alltrim(Padl(pnNum, 1000))
lnDot = at('.', y)

Return IIF(lnDot = 0, 0, Len(lcNum) - lnDot)
>How can I find the position of the decimal point in a numerical value. I tried to convert the number to string but it rounded the value.
>
>thanks
>Nick
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform