fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
        let prec = if let Some(prec) = formatter.precision() {
            prec
        } else {
            6
        };
        match self.float {
            None => {
                write!(formatter, " 0.{:0<width$}E{:+03}", 0, 0, width = prec)
            }
            Some(f) => {
                let float = f * self.mult;
                let exponant = float.log10() as i32 + 1;
                let decimals = float.abs() * 10f64.powi(prec as i32 - exponant);
                let decimals = decimals.round() as usize;
                if float.is_sign_negative() {
                    write!(formatter,
                           "-0.{:0<width$}E{:+03}",
                           decimals,
                           exponant,
                           width = prec)
                } else {
                    write!(formatter,
                           " 0.{:0<width$}E{:+03}",
                           decimals,
                           exponant,
                           width = prec)
                }
            }
        }
    }
/// Format the structure into a fortran style exponential.
Format the structure into a fortran style exponential.
Format the structure into a fortran style exponential .
fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
        let prec = if let Some(prec) = formatter.precision() {
            prec
        } else {
            6
        };
        match self.float {
            None => {
                write!(formatter, " 0.{:0<width$}E{:+03}", 0, 0, width = prec)
            }
            Some(f) => {
                let float = f * self.mult;
                let exponant = float.log10() as i32 + 1;
                let decimals = float.abs() * 10f64.powi(prec as i32 - exponant);
                let decimals = decimals.round() as usize;
                if float.is_sign_negative() {
                    write!(formatter,
                           "-0.{:0<width$}E{:+03}",
                           decimals,
                           exponant,
                           width = prec)
                } else {
                    write!(formatter,
                           " 0.{:0<width$}E{:+03}",
                           decimals,
                           exponant,
                           width = prec)
                }
            }
        }
    }
fn fmt ( & self , formatter : & mut std :: fmt :: Formatter ) -> std :: fmt :: Result { let prec = if let Some ( prec ) = formatter . precision ( ) { prec } else { 6 } ; match self . float { None => { write ! ( formatter " " 0 0 width prec ) } Some ( f ) => { let float = f * self . mult ; let exponant = float . log10 ( ) as i32 + 1 ; let decimals = float . abs ( ) * 10f64 . powi ( prec as i32 - exponant ) ; let decimals = decimals . round ( ) as usize ; if float . is_sign_negative ( ) { write ! ( formatter " " decimals exponant width prec ) } else { write ! ( formatter " " decimals exponant width prec ) } } } }
Format the structure into a fortran style exponential.
Format the structure into a fortran style exponential .
&self
formatter
&mut std::fmt::Formatter
&self
formatter
&mut std::fmt::Formatter