Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to check decimal points
Message
 
 
To
14/06/2004 15:38:17
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00913595
Message ID:
00913596
Views:
37
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>Is there a way to know how many decimal places a current variable has?
>
>Example:
>x=1.000
>y=3.0
>z=5.12004
>* How to get the decimal places for each variable?
>
>
Try
lnNumber = 1.000
lcStr = PADL(lnNumber,20)
IF AT(".", lcStr) = 0
  ? 0
ELSE
  ? LEN(SUBSTR(lcStr, AT(".", lcStr)+1))
ENDIF
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform