Logo

Programming-Idioms

History of Idiom 146 > diff from v10 to v11

Edit summary for version 11 by TheVTM:
[Rust] Fixed demo link

Version 10

2017-04-27, 10:24:22

Version 11

2017-04-29, 07:06:30

Idiom #146 Convert string to floating point number

Extract floating point value f from its string representation s

Idiom #146 Convert string to floating point number

Extract floating point value f from its string representation s

Extra Keywords
real conversion
Extra Keywords
real conversion
Code
let f = s.parse::<f32>().unwrap();
Code
let f = s.parse::<f32>().unwrap();
Doc URL
https://doc.rust-lang.org/std/primitive.str.html#method.parse
Doc URL
https://doc.rust-lang.org/std/primitive.str.html#method.parse
Demo URL
https://is.gd/r7DSaS
Demo URL
https://play.rust-lang.org/?gist=520a098a33da379c7221f8ca40e3bfb6&version=stable&backtrace=0