Enum reckoner::RoundMode[][src]

pub enum RoundMode {
    Down,
    Up,
    HalfUp,
    HalfDown,
}

as a decimal value. There are four rounding modes currently supported.

Variants

Down

Truncates the value toward zero.

For example, 12.009 to 2 decimal places becomes 12.00.

Up

Rounds the value away from zero.

For example, 12.001 to 2 decimal places becomes 12.01, but 12.000 to 2 decimal places remains 12.00.

HalfUp

Rounds the value to nearest digit, half rounds upward.

For example, 12.005 to 2 decimal places becomes 12.01, but 12.004 to 2 decimal places becomes 12.00.

HalfDown

Rounds the value to nearest digit, half goes toward zero.

For example, 12.005 to 2 decimal places becomes 12.00, but 12.006 to 2 decimal places becomes 12.01.

Trait Implementations

impl Into<u32> for RoundMode[src]

impl TryFrom<u32> for RoundMode[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.