Getting the number of decimal places: Difference between revisions

m
m (→‎{{header|Phix}}: minor tidy)
Line 145:
end if
integer dot = find('.',t)
nd = max(0,iff(dot?length(t)-dot-e:0)-e)
end if
elsif string(o) then
s = o
nd = length(s)-find('.',s)
else
crash("unknown type")
end if
if nd=-1 then
nd = length(s)-find('.',s)
end if
s = shorten(s,ml:=5)
7,822

edits