pub fn as_f(&self) -> crate::Result<f64> {
        match &self {
            Self::I32(v) => Ok(*v as f64),
            Self::U32(v) => Ok(*v as f64),
            Self::F64(v) => Ok(*v),
            Self::I64(v) => Ok(*v as f64),
            Self::U64(v) => Ok(*v as f64),
            Self::Bool(v) => {
                if *v {
                    return Ok(1.0);
                }
                Ok(0.0)
            }
            Self::Str(v) => match v.parse::<f64>() {
                Ok(f) => Ok(f),
                Err(e) => Err(error::parse_value(e.into())),
            },
            _ => Err(error::unimplement("can not convert to f64"))
        }
    }
/// If Value can parse to f64, returns an f64. Returns Err otherwise.
If Value can parse to f64, returns an f64. Returns Err otherwise.
If Value can parse to f64 returns an f64 . Returns Err otherwise .
pub fn as_f(&self) -> crate::Result<f64> {
        match &self {
            Self::I32(v) => Ok(*v as f64),
            Self::U32(v) => Ok(*v as f64),
            Self::F64(v) => Ok(*v),
            Self::I64(v) => Ok(*v as f64),
            Self::U64(v) => Ok(*v as f64),
            Self::Bool(v) => {
                if *v {
                    return Ok(1.0);
                }
                Ok(0.0)
            }
            Self::Str(v) => match v.parse::<f64>() {
                Ok(f) => Ok(f),
                Err(e) => Err(error::parse_value(e.into())),
            },
            _ => Err(error::unimplement("can not convert to f64"))
        }
    }
pub fn as_f ( & self ) -> crate :: Result < f64 > { match & self { Self :: I32 ( v ) => Ok ( * v as f64 ) , Self :: U32 ( v ) => Ok ( * v as f64 ) , Self :: F64 ( v ) => Ok ( * v ) , Self :: I64 ( v ) => Ok ( * v as f64 ) , Self :: U64 ( v ) => Ok ( * v as f64 ) , Self :: Bool ( v ) => { if * v { return Ok ( 1.0 ) ; } Ok ( 0.0 ) } Self :: Str ( v ) => match v . parse :: < f64 > ( ) { Ok ( f ) => Ok ( f ) , Err ( e ) => Err ( error :: parse_value ( e . into ( ) ) ) , } , _ => Err ( error :: unimplement ( " " ) ) } }
If Value can parse to f64, returns an f64.
If Value can parse to f64 returns an f64 .
&self