diff --git a/utils/fixed_decimal/src/decimal.rs b/utils/fixed_decimal/src/decimal.rs index 98d98462666..59f536a1346 100644 --- a/utils/fixed_decimal/src/decimal.rs +++ b/utils/fixed_decimal/src/decimal.rs @@ -1017,23 +1017,23 @@ impl FixedDecimal { /// # Examples /// /// ``` - /// use fixed_decimal::{FixedDecimal, RoundingIncrement}; + /// use fixed_decimal::{FixedDecimal, RoundingCoarseness}; /// # use std::str::FromStr; /// /// let mut dec = FixedDecimal::from_str("-3.5").unwrap(); - /// dec.trunc_with_increment(0, RoundingIncrement::I2); + /// dec.trunc_coarse(0, RoundingCoarseness::MultiplesOf2); /// assert_eq!("-2", dec.to_string()); /// let mut dec = FixedDecimal::from_str("7.57").unwrap(); - /// dec.trunc_with_increment(-1, RoundingIncrement::I5); + /// dec.trunc_coarse(-1, RoundingCoarseness::MultiplesOf5); /// assert_eq!("7.5", dec.to_string()); /// let mut dec = FixedDecimal::from_str("5.45").unwrap(); - /// dec.trunc_with_increment(-2, RoundingIncrement::I25); + /// dec.trunc_coarse(-2, RoundingCoarseness::MultiplesOf25); /// assert_eq!("5.25", dec.to_string()); /// let mut dec = FixedDecimal::from_str("9.99").unwrap(); - /// dec.trunc_with_increment(-1, RoundingIncrement::I25); + /// dec.trunc_coarse(-1, RoundingCoarseness::MultiplesOf25); /// assert_eq!("7.5", dec.to_string()); /// let mut dec = FixedDecimal::from_str("9.99").unwrap(); - /// dec.trunc_with_increment(-2, RoundingIncrement::I2); + /// dec.trunc_coarse(-2, RoundingCoarseness::MultiplesOf2); /// assert_eq!("9.98", dec.to_string()); /// ``` pub fn trunc_coarse(&mut self, position: i16, coarseness: RoundingCoarseness) { @@ -1049,8 +1049,8 @@ impl FixedDecimal { self.upper_magnitude = cmp::max(self.upper_magnitude, magnitude); // 2. If the rounding position is *lower than* the rightmost nonzero digit and we're - // not rounding to a custom increment, exit early. - // Don't exit if the increment is not `1`, because the algorithm could need to truncate the + // rounding to a coarseness of 1, exit early. + // Don't exit if the coarseness is not `1`, because the next steps could need to truncate the // last non-zero digit. if self.is_zero() || (magnitude < self.nonzero_magnitude_end()