>Does anyone know of a way to determine the number of decimal places of a numeric variable or of a way to return the correct number of decimals as a String?
>
>I can't find a function to determine how many decimals are stored in the variable.
>
>for example:
>
>
>
>n = 20.000
>? n
>? TRANSFORM(n)
>
>
>
>
>I'm feeling pretty stupid not be able to figure this one out.
You could do:
cN = ALLTRIM(PADR(n,20))
nDecimal = RAT(".",cN)
or combine into one statement:
nDecimal = RAT(".",ALLTRIM(PADR(n,20)))