Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Finding the decimal
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00144345
Message ID:
00144501
Views:
23
Hi Sandy,

>How do we find how many decimal places there are.

As Fred wrote, if you want to avoid AFIELD(), PADR() (or PADL()) will do the trick:

IIF( 20-RAT(".",PADL(,20))==20, 0, 20-RAT(".",PADL(,20)) )

This expression evaluates to the number of decimal places after the point.

>We can't use str() because it seems to stop at the decimal point.

STR() requires the number of decimals as the third parameter. If there are more than specified, it will round the value.

Christof
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform