num-traits icon indicating copy to clipboard operation
num-traits copied to clipboard

Add `round_to_digit` method to `Float` trait.

Open amab8901 opened this issue 10 months ago • 2 comments

Add round_to_digit method to Float trait.

Example usage

let full_float = 12.34567;
let rounded_float = full_float.round_to_digit(2);
assert_eq!(rounded_float, 12.35);

amab8901 avatar Apr 10 '24 18:04 amab8901