Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
let i = Math.trunc(x),
n = x - i,
y = Math.log(n) / Math.log(.1),
d = Math.pow(10, Math.trunc(y) + 1)
x = Math.trunc(x * d) / d
str(x,s);
p := Pos('.',s) + 1;
while (s[p] = '0') do inc(p);
setlength(s,p);