Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding position of decimal
Message
From
23/03/2001 11:14:32
 
 
To
22/03/2001 14:24:11
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00487442
Message ID:
00488061
Views:
11
Whoops!!!

Sorry, the line below - "lnDot = at('.', y)", of course, should read:

lnDot = at('.', lcNum)

Don't ask.

Alan

>? 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
Reply
Map
View

Click here to load this message in the networking platform