Skip to main content

two

Function two 

Source
pub fn two(x: f64) -> String
Expand description

Two decimals, rounding a tie away from zero the way the TypeScript port’s toFixed(2) does.

Rust rounds a tie to even, so 0.125 would print 0.12 here and 0.13 there; every rate and probability in a report goes through this so the two ports’ reports can be compared byte for byte.