time::formatting

Function format_float

source
pub(crate) fn format_float(
    output: &mut impl Write,
    value: f64,
    digits_before_decimal: u8,
    digits_after_decimal: Option<NonZeroU8>,
) -> Result<usize>
Expand description

Write the floating point number to the output, returning the number of bytes written.

This method accepts the number of digits before and after the decimal. The value will be padded with zeroes to the left if necessary.