Trait RoundFloat

Source
pub trait RoundFloat<T> {
    // Required method
    fn round_float(self, decimal_places: T) -> Self
       where Self: Sized;
}
Expand description

Trait for rounding floating-point numbers to a specified number of decimal places.

Required Methods§

Source

fn round_float(self, decimal_places: T) -> Self
where Self: Sized,

Rounds the floating-point number to the given number of decimal places.

§Arguments
  • decimal_places - The number of decimal places to round to.
§Returns

The rounded floating-point number.

Implementations on Foreign Types§

Source§

impl<T> RoundFloat<T> for f64
where i32: TryFrom<T>, <i32 as TryFrom<T>>::Error: Display,

Source§

fn round_float(self, decimal_places: T) -> f64

Implementors§