Skip to main content

Module round

Module round 

Source
Expand description

Utilities for rounding money amounts to the nearest hundredth or ten-thousandth part.

Functionsยง

assert_rounded_2
assert_rounded_4
assert_rounded_6
assert_rounded_8
round_2
Round to two decimal places. This function uses f64::round() which rounds halfway cases away from 0.0.
round_4
Round to four decimal places. This function uses f64::round() which rounds halfway cases away from 0.0.
round_6
Round to six decimal places. This function uses f64::round() which rounds halfway cases away from 0.0.
round_8
Round to eight decimal places. This function uses f64::round() which rounds halfway cases away from 0.0.