pub fn float_repr(value: f64) -> String
Python’s repr(float) (also its str()): the shortest round-tripping digits, in scientific notation when the exponent is below -4 or at least 16.
repr(float)
str()