fn from(signed_amount: Option<f64>) -> OutAndInflow {
        signed_amount.map_or(OutAndInflow { 
            outflow: String::new(),
            inflow: String::new()
        }, |signed_amount| {
            if signed_amount < 0.0 {
                OutAndInflow {
                    outflow: format!("{0:.2}", signed_amount * -1.0),
                    inflow: String::new()
                }
            } else {
                OutAndInflow {
                    outflow: String::new(),
                    inflow: format!("{0:.2}", signed_amount),
                }
            }
        }) 
    }
/// Takes a signed number and converts it to the OutAndInflow struct. 
///
/// If the option is empty, a struct with empty strings will be returned,
Takes a signed number and converts it to the OutAndInflow struct.
If the option is empty, a struct with empty strings will be returned.
Takes a signed number and converts it to the OutAndInflow struct . If the option is empty a struct with empty strings will be returned .
fn from(signed_amount: Option<f64>) -> OutAndInflow {
        signed_amount.map_or(OutAndInflow { 
            outflow: String::new(),
            inflow: String::new()
        }, |signed_amount| {
            if signed_amount < 0.0 {
                OutAndInflow {
                    outflow: format!("{0:.2}", signed_amount * -1.0),
                    inflow: String::new()
                }
            } else {
                OutAndInflow {
                    outflow: String::new(),
                    inflow: format!("{0:.2}", signed_amount),
                }
            }
        }) 
    }
fn from ( signed_amount : Option < f64 > ) -> OutAndInflow { signed_amount . map_or ( OutAndInflow { outflow : String :: new ( ) , inflow : String :: new ( ) } , | signed_amount | { if signed_amount < 0.0 { OutAndInflow { outflow : format ! ( " " signed_amount 1.0 ) , inflow : String :: new ( ) } } else { OutAndInflow { outflow : String :: new ( ) , inflow : format ! ( " " signed_amount ) , } } } ) }
Takes a signed number and converts it to the OutAndInflow struct.
Takes a signed number and converts it to the OutAndInflow struct .
signed_amount
Option<f64>
signed_amount
Option<f64>