Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for number of digits in a number
Message
From
26/12/2001 07:44:03
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00598086
Message ID:
00598125
Views:
25
Hello Nadya.

>> I've checked old messages, but didn't find a solution for this problem: I need to find out the number of digits in a number. <<

Just to give you one more idea, if you have FoxTools loaded, you can use StrFilter() like so:

LEN( STRFILTER( TRANSFORM( MyNumericValue ), "0123456789" ) )

But this solution has the same limitation as the one Vlas suggested using CHRTRAN.

>> Say, I have 12.3456000 - the number of digits should be seven. <<

By my reckoning, there are 9 digits there if you include the trailing zero's. Or did you really mean the number of digits to the right of the decimal point? If this is the case, something like this should work:

LEN( GETWORDNUM( TRANSFORM( MyNumericValue ), 2, '.' ) )
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform