pub fn scale(&self, mut num: f64) -> (f64, &'static str) {
        let base = self.base as f64;
        let mut u = "";
        let mut n2 = num;
        // use n2 as a delayed write to not downsize num on last entry numbers
        for unit in &self.units {
            num = n2;
            u = unit;
            if num.abs() >= base {
                n2 = num / base;
            } else {
                break;
            }
        }
        (num, u)
    }
/// Scale a number and return the scaled number with the unit.
Scale a number and return the scaled number with the unit.
Scale a number and return the scaled number with the unit .
pub fn scale(&self, mut num: f64) -> (f64, &'static str) {
        let base = self.base as f64;
        let mut u = "";
        let mut n2 = num;
        // use n2 as a delayed write to not downsize num on last entry numbers
        for unit in &self.units {
            num = n2;
            u = unit;
            if num.abs() >= base {
                n2 = num / base;
            } else {
                break;
            }
        }
        (num, u)
    }
pub fn scale ( & self , mut num : f64 ) -> ( f64 , & ' static str ) { let base = self . base as f64 ; let mut u = " " ; let mut n2 = num ; // use n2 as a delayed write to not downsize num on last entry numbers for unit in & self . units { num = n2 ; u = unit ; if num . abs ( ) >= base { n2 = num / base ; } else { break ; } } ( num , u ) }
Scale a number and return the scaled number with the unit.
Scale a number and return the scaled number with the unit .
&self
num
f64
&self
num
f64