Trait fpdec_core::Round
source · [−]pub trait Round where
Self: Sized, {
fn round(self, n_frac_digits: i8) -> Self;
fn checked_round(self, n_frac_digits: i8) -> Option<Self>;
}
Expand description
Rounding a number to a given number of fractional digits.
Required methods
Returns a new Self
instance with its value rounded to n_frac_digits
fractional digits according to the current RoundingMode.
fn checked_round(self, n_frac_digits: i8) -> Option<Self>
fn checked_round(self, n_frac_digits: i8) -> Option<Self>
Returns a new Self
instance with its value rounded to n_frac_digits
fractional digits according to the current RoundingMode
, wrapped in
Option::Some
, or Option::None
if the result can not be
represented by Self
.