Skip to main content

string_to_precision

Function string_to_precision 

Source
pub fn string_to_precision(a: &str, decimals: u32, mode: u8) -> Option<String>
Expand description

Round to decimals decimal places using the specified rounding mode. mode 0 = truncate (keeps a - on a negative input truncated to zero), 3 = ceiling, 4 = floor, any other = round half to even.