pub fn js_number(x: f64) -> String
A number as JavaScript’s Number.prototype.toString prints it: the shortest digits that read back as the same double, an integer without a point, an exponent below 1e-6 and from 1e21.
Number.prototype.toString