Skip to content

Provide option to format 0 #13

@ckruse

Description

@ckruse

Hey there,

the current implementation hard-codes 0 to "0":

 } else if num.is_zero() {
            "0"

This means, we can't format zero values, e.g.

    let mut fmt = numfmt::Formatter::new()
        .separator('.')?
        .precision(numfmt::Precision::Decimals(2))
        .suffix(" €")?;

    let num = fmt.fmt2(*value);

Now num is just "0" instead of "0,00 €".

Can you provide an option to also format 0?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions