rust convert a string (with decimals) to a floating point number. code example
Example 1: rust convert a string (with decimals) to a floating point number.
let f = s.parse::().unwrap();
// Can also do:
let f: f32 = s.parse().unwrap();
Example 2: rust convert floating point number, to a string, with decimal digits.
let s = format!("{:.2}", x);