Skip to main content

string_to_number

Function string_to_number 

Source
pub fn string_to_number(text: &str) -> f64
Expand description

ToNumber applied to a string.

Leading and trailing whitespace is allowed; anything else must be a valid numeric literal, because a failed parse is NaN rather than a prefix match. The empty string is 0, which is a common source of surprise.