Skip to main content

round_to_decimals

Function round_to_decimals 

Source
pub fn round_to_decimals(value: f64, decimals: u8) -> f64
Expand description

Rounds an f64 to the requested number of decimal places.

Halfway values follow f64::round and therefore round away from zero.