>>I have a series of numbers with up to 9 significant digits after the decimal point and would like to truncate the character values down to 4 significant digits.
>>
>>For example I have the following two values:
>>
>>123.456789012
>>98.765432109
>>
>>I want to return these values:
>>
>>123.4567
>>98.7654
>>
>>I can write a function to use something like ATC() to find the decimal point but is there a better way? Sergey, you will no doubt have something interesting and insightful so thanks in advance...:>)
>
>
>IANS but how about ROUND(lnX, 4)?
It gives you the four decimals, period. Not the four significant digits. If I remember correctly, significant digits are those that remain when leading and trailing zeros are ignored. The following code will display four significant digits across the range:
x=123456789012
Set Decimals To 10
For i=1 To 18
?x, Round(x, Iif(Abs(x)>1000, 3,4)-Log10(Abs(x))) At 40
x=x/10
Endfor
But now since you got the stars, I figure the originator had some other idea about the meaning of the term "significant digits".