pub fn to_float(&self) -> Option<f64> {
        match self {
            Value::Int(n) => Some(*n as f64),
            Value::BigInt(n) => Some(n.to_f64().unwrap()),
            Value::Float(f) => Some(*f),
            Value::String(s, _) => {
                let n_r = s.parse::<f64>();
                match n_r {
                    Ok(n) => {
                        return Some(n);
                    }
                    _ => {
                        return None;
                    }
                }
            }
            Value::Null => Some(0.0),
            _ => None,
        }
    }
/// Convert the current value into a floating-point number (f64).
/// If the value is not representable in that type, the result
/// will be None.
Convert the current value into a floating-point number (f64).
If the value is not representable in that type, the result
will be None.
Convert the current value into a floating - point number ( f64 ) . If the value is not representable in that type the result will be None .
pub fn to_float(&self) -> Option<f64> {
        match self {
            Value::Int(n) => Some(*n as f64),
            Value::BigInt(n) => Some(n.to_f64().unwrap()),
            Value::Float(f) => Some(*f),
            Value::String(s, _) => {
                let n_r = s.parse::<f64>();
                match n_r {
                    Ok(n) => {
                        return Some(n);
                    }
                    _ => {
                        return None;
                    }
                }
            }
            Value::Null => Some(0.0),
            _ => None,
        }
    }
pub fn to_float ( & self ) -> Option < f64 > { match self { Value :: Int ( n ) => Some ( * n as f64 ) , Value :: BigInt ( n ) => Some ( n . to_f64 ( ) . unwrap ( ) ) , Value :: Float ( f ) => Some ( * f ) , Value :: String ( s , _ ) => { let n_r = s . parse :: < f64 > ( ) ; match n_r { Ok ( n ) => { return Some ( n ) ; } _ => { return None ; } } } Value :: Null => Some ( 0.0 ) , _ => None , } }
Convert the current value into a floating-point number (f64).
Convert the current value into a floating - point number ( f64 ) .
&self