pub enum RoundingMode {
Down,
Up,
Floor,
Ceiling,
HalfUp,
HalfDown,
HalfEven,
}Expand description
How a Decimal resolves the digits it must drop when rounding to a smaller
scale. HalfEven (banker’s rounding) is the money/finance default: the unbiased
tie-break that does not drift a long column of sums upward.
Variants§
Down
Toward zero (truncate).
Up
Away from zero.
Floor
Toward −∞.
Ceiling
Toward +∞.
HalfUp
Nearest; ties away from zero.
HalfDown
Nearest; ties toward zero.
HalfEven
Nearest; ties to the even neighbour (banker’s rounding).
Trait Implementations§
Source§impl Clone for RoundingMode
impl Clone for RoundingMode
Source§fn clone(&self) -> RoundingMode
fn clone(&self) -> RoundingMode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RoundingMode
impl Debug for RoundingMode
Source§impl Hash for RoundingMode
impl Hash for RoundingMode
Source§impl PartialEq for RoundingMode
impl PartialEq for RoundingMode
Source§fn eq(&self, other: &RoundingMode) -> bool
fn eq(&self, other: &RoundingMode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for RoundingMode
impl Eq for RoundingMode
impl StructuralPartialEq for RoundingMode
Auto Trait Implementations§
impl Freeze for RoundingMode
impl RefUnwindSafe for RoundingMode
impl Send for RoundingMode
impl Sync for RoundingMode
impl Unpin for RoundingMode
impl UnsafeUnpin for RoundingMode
impl UnwindSafe for RoundingMode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more