>>Why the arbitrary length of 20? The article suggests the workaround of changing it to a string and back to numeric, so how about just
ROUND( VAL( TRANSFORM(tnNumber)), tnDecimals)
>
>?transform(tnnumber)
>tnnumber=2.0000000056984984924892482948294829
>?transform(tnnumber)
>tnnumber=2.00000000569
>tnnumber=0.00000000569
>?transform(tnnumber)
>tnnumber=0.02000000569
>?transform(tnnumber)
>?val(transform(tnnumber))
>
>The maximum number of decimals, BTW, is 12, as I just found.
tnnumber=2.0000000056984984924892482948294829
?round(val(str(tnnumber,20,16)),15)
Doesn't work correctly...
If it's not broken, fix it until it is.
My Blog