I'm just started to learn rust and have problem with conversion from string to f32. In nightly 0.11 was function "from_str" and i use it like this:
let f = std::f32::from_str("0.11", 10);
In current 1.0.0 alpha function not exists. How to convert from str to f32 now?
you can use parse, now.
let f = "0.11".parse::<f32>(); // returns a Result<f32, std::num::ParseFloatError>`
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With