Skip to main content

bankers_round

Function bankers_round 

Source
pub fn bankers_round(mantissa: i128, excess: u32) -> i128
Expand description

Rounds a mantissa by removing excess decimal digits using banker’s rounding (half to even).

Given a mantissa representing a number with excess extra decimal places beyond the desired precision, divides by 10^excess and rounds the result using round-half-to-even semantics.