[][src]Function json_compare::parse_float

pub fn parse_float(val: &Value) -> Option<f64>

From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat parseFloat is a top-level function and not a method of any object. - If parseFloat encounters a character other than a plus sign (+), minus sign (- U+002D HYPHEN-MINUS), numeral (0–9), decimal point (.), or exponent (e or E), it returns the value up to that character, ignoring the invalid character and characters following it. - A second decimal point also stops parsing (characters up to that point will still be parsed). - Leading and trailing spaces in the argument are ignored. - If the argument’s first character can’t be converted to a number (it’s not any of the above characters), parseFloat returns NaN. - parseFloat can also parse and return Infinity. - parseFloat converts BigInt syntax to Numbers, losing precision. This happens because the trailing n character is discarded.

This function does not support BigInt syntax, since JSON does not support it.