pub fn fmt_g(v: f64) -> String
Python’s %g / f"{v:g}": shortest form, trailing zeros dropped.
%g
f"{v:g}"