Trait RoundTo

Source
pub trait RoundTo {
    // Required method
    const fn round_to(self, digits: i64) -> Self;
}
Expand description

✅ Rounds the number to the nearest value with the specified number of fractional digits, away from zero on tie. If rounding would cause an overflow, returns the closest representable result instead.

§Panics

This function never panics.

Required Methods§

Source

const fn round_to(self, digits: i64) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§