Skip to main content

format_go_float_f

Function format_go_float_f 

Source
pub fn format_go_float_f(v: f64) -> String
Expand description

Go’s strconv.FormatFloat(v, 'f', -1, 64).

'f' forbids exponent form at any magnitude, and -1 asks for the shortest digit string that round-trips. Rust’s {} gives the same shortest digits but switches to 1e300-style output past a threshold, so the exponent case is expanded positionally from the shortest form rather than re-derived — which keeps the digits identical to Go’s.