Hi Kent,
function fmt( double d, sys s ) as string
l = trunc d
r = frac d
string r2 = str(r)
if s = 0 then return str(l)
return str(l) + "." + mid( r2, 3, s )
end function
function fmt2( double d, sys s ) as string
double l = trunc d
double r = frac d
string r2 = str(r)
if s = 0 then return str(l)
return str(l) + "." + mid( r2, 3, s )
end function
print fmt(59.9876543210,0)
print fmt(59.9876543210,1)
print fmt(59.9876543210,2)
print fmt(59.9876543210,3)
print fmt(59.9876543210,4)
print fmt(59.9876543210,5)
print "okay"
print fmt2(59.9876543210,0)
print fmt2(59.9876543210,1)
print fmt2(59.9876543210,2)
print fmt2(59.9876543210,3)
print fmt2(59.9876543210,4)
print fmt2(59.9876543210,5)
print "okay"