Skip to main content

value_to_f64

Function value_to_f64 

Source
pub fn value_to_f64(v: &Value, coerce_bool: bool) -> Option<f64>
Expand description

Coerce a Value to f64.

  • Integer/Float: direct conversion
  • String: parse as f64
  • Bool: true1.0, false0.0 (when coerce_bool is true)
  • Other types: None