Skip to main content

number_format

Function number_format 

Source
pub fn number_format(
    num: Number,
    decimals: i64,
    decimal_separator: &[u8],
    thousands_separator: &[u8],
) -> Vec<u8> ⓘ
Expand description

PHP number_format($num, $decimals, $decimal_separator, $thousands_separator): rounds half away from zero (with round’s pre-rounding), groups the integer digits by three and never prints -0. Infinite floats print inf and NaN nan, with no sign. Pass "." and "," for PHP’s defaults.