new_york_utils 0.1.9

Library for calculation some things
Documentation
1
2
3
4
5
6
7
8
9
10
11
pub fn round_to_nearest(num: f64, base: f64) -> f64 {
    (num / base).round() * base
}

pub fn floor_to_nearest(num: f64, base: f64) -> f64 {
    (num / base).floor() * base
}

pub fn ceil_to_nearest(num: f64, base: f64) -> f64 {
    (num / base).ceil() * base
}