Function math::round::half_to_odd [] [src]

pub fn half_to_odd(value: f64, scale: u8) -> f64

Round half to nearest odd number.

Round value to scale number of decimal digits rounding half to nearest odd number.

Arguments

  • value - value to round
  • scale - number of decimal digits

Example

use math::round;

let rounded = round::half_to_odd(3.14159, 3);
assert_eq!(rounded, 3.141);