Skip to main content

format

Function format 

Source
pub fn format(value: f64) -> String
Expand description

String(n) in JS, i.e. ECMAScript Number::toString(n, 10).

Uses the shortest round-tripping digits (which Rust’s {:e} also produces) laid out with the JS rules: plain notation for decimal exponents in -6..21, exponential otherwise.