pub fn round(&self, unit: Unit) -> Self {
        if unit.multiply() == 0 {
            return *self;
        }
        let m = unit.multiply() as i32;
        let clip = self.0 % m;
        match m / 2 {
            _ if clip == 0 => *self, // don't round
            x if clip <= -x => Measure32(self.0 - clip - m),
            x if clip >= x => Measure32(self.0 - clip + m),
            _ => Measure32(self.0 - clip),
        }
    }
/// Rounds to the given Unit.
Rounds to the given Unit.
Rounds to the given Unit .
pub fn round(&self, unit: Unit) -> Self {
        if unit.multiply() == 0 {
            return *self;
        }
        let m = unit.multiply() as i32;
        let clip = self.0 % m;
        match m / 2 {
            _ if clip == 0 => *self, // don't round
            x if clip <= -x => Measure32(self.0 - clip - m),
            x if clip >= x => Measure32(self.0 - clip + m),
            _ => Measure32(self.0 - clip),
        }
    }
pub fn round ( & self , unit : Unit ) -> Self { if unit . multiply ( ) == 0 { return * self ; } let m = unit . multiply ( ) as i32 ; let clip = self . 0 % m ; match m / 2 { _ if clip == 0 => * self , // don't round x if clip <= - x => Measure32 ( self . 0 - clip - m ) , x if clip >= x => Measure32 ( self . 0 - clip + m ) , _ => Measure32 ( self . 0 - clip ) , } }
Rounds to the given Unit.
Rounds to the given Unit .
&self
unit
Unit
&self
unit
Unit