Skip to main content

to_fixed

Function to_fixed 

Source
pub fn to_fixed(n: f64, p: u32) -> String
Expand description

JavaScript’s n.toFixed(p): the EXACT binary value rounded half away from zero ((2.5).toFixed(0) = 3, (1.005).toFixed(2) = 1.00).