Trait fpdec_core::Round
source · pub trait Roundwhere
Self: Sized,{
// Required methods
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§
sourcefn round(self, n_frac_digits: i8) -> Self
fn round(self, n_frac_digits: i8) -> Self
Returns a new Self
instance with its value rounded to n_frac_digits
fractional digits according to the current RoundingMode.
sourcefn 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
.