pub enum RoundingMode {
Ceil,
Floor,
Expand,
Trunc,
HalfCeil,
HalfFloor,
HalfExpand,
HalfTrunc,
HalfEven,
}
Variants§
Ceil
round toward +∞. Positive values round up. Negative values round “more positive”.
Floor
round toward -∞. Positive values round down. Negative values round “more negative”.
Expand
round away from 0. The magnitude of the value is always increased by rounding. Positive values round up. Negative values round “more negative”.
Trunc
round toward 0. This magnitude of the value is always reduced by rounding. Positive values round down. Negative values round “less negative”.
HalfCeil
ties toward +∞. Values above the half-increment round like Ceil
(towards +∞), and below like Floor
(towards -∞). On the half-increment, values round like Ceil
.
HalfFloor
ties toward -∞. Values above the half-increment round like Ceil
(towards +∞), and below like Floor
(towards -∞). On the half-increment, values round like Floor
.
HalfExpand
ties away from 0. Values above the half-increment round like Expand
(away from zero), and below like Trunc
(towards 0). On the half-increment, values round like Expand
.
HalfTrunc
ties toward 0. Values above the half-increment round like Expand
(away from zero), and below like Trunc
(towards 0). On the half-increment, values round like Trunc
.
HalfEven
ties towards the nearest even integer. Values above the half-increment round like Expand
(away from zero), and below like Trunc
(towards 0). On the half-increment values round towards the nearest even digit.
Trait Implementations§
Source§impl Clone for RoundingMode
impl Clone for RoundingMode
Source§fn clone(&self) -> RoundingMode
fn clone(&self) -> RoundingMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RoundingMode
impl Debug for RoundingMode
Source§impl Default for RoundingMode
impl Default for RoundingMode
Source§fn default() -> RoundingMode
fn default() -> RoundingMode
Source§impl Display for RoundingMode
impl Display for RoundingMode
Source§impl From<RoundingMode> for JsValue
impl From<RoundingMode> for JsValue
Source§fn from(value: RoundingMode) -> Self
fn from(value: RoundingMode) -> Self
Source§impl Hash for RoundingMode
impl Hash for RoundingMode
Source§impl PartialEq for RoundingMode
impl PartialEq for RoundingMode
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more