/// Helper for producing a column with the change in value between succesive iterations,
/// just like the one produced by `basic_output_fn`.
Helper for producing a column with the change in value between succesive iterations,
just like the one produced by `basic_output_fn`.
Helper for producing a column with the change in value between succesive iterations just like the one produced by ` basic_output_fn ` .
pub fn output_fn_dv_formatter(
    prefix: &str,
    precision: usize,
) -> impl Clone + FnMut(f64) -> String {
    let mut last_value = None;
    // sign leading_digit decimal (precision digits) "e-10"
    let float_width = 1 + 1 + 1 + precision + 4;
    let width = prefix.len() + 1 + float_width;
    let prefix = prefix.to_string();
    move |value| {
        let out = match last_value {
            None => format!("{:width$}", "", width=width),
            Some(last) => format!(
                "{} {:+f$.prec$e}", prefix, value - last,
                f=float_width, prec=precision,
            ),
        };
        last_value = Some(value);
        out
    }
}
pub fn output_fn_dv_formatter ( prefix : & str , precision : usize , ) -> impl Clone + FnMut ( f64 ) -> String { let mut last_value = None ; // sign leading_digit decimal (precision digits) "e-10" let float_width = 1 + 1 + 1 + precision + 4 ; let width = prefix . len ( ) + 1 + float_width ; let prefix = prefix . to_string ( ) ; move | value | { let out = match last_value { None => format ! ( " " " " width width ) , Some ( last ) => format ! ( " " prefix value last f float_width prec precision ) , } ; last_value = Some ( value ) ; out } }
Helper for producing a column with the change in value between succesive iterations,
just like the one produced by `basic_output_fn`.
Helper for producing a column with the change in value between succesive iterations just like the one produced by ` basic_output_fn ` .
prefix
&str
precision
usize