fix comment

This commit is contained in:
Simon Gardling 2022-03-22 14:05:33 -04:00
parent b89cf04dcc
commit d71c34a9fb

View File

@ -137,7 +137,7 @@ fn stepped_vector_test() {
assert_eq!(stepped_vector.get_index((max + 1) as f64), None);
}
// Rounds f64 to specific number of decimal places
/// Rounds f64 to `n` decimal places
pub fn decimal_round(x: f64, n: usize) -> f64 {
let large_number: f64 = 10.0_f64.powf(n as f64); // 10^n
(x * large_number).round() / large_number // round and devide in order to cut