Trait RoundFloat

Source
pub trait RoundFloat {
    // Required method
    fn round_float(self, decimal: i32) -> 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: i32) -> Self
where Self: Sized,

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

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

The rounded floating-point number.

Implementations on Foreign Types§

Source§

impl RoundFloat for f64

Source§

fn round_float(self, decimal: i32) -> f64

Implementors§