Skip to content

Remove trailing zeros for integer input OR improve documentation #19

@mingos777

Description

@mingos777

In #18 trailing zeroes were supposedly fixed, however, I am unable to understand how to remove them completely when the input value is an integer. Here's my case:

expect(format("# ###,#", 19.9, {})).to.equal("19,9"); // pass
expect(format("# ###,#", 20, {})).to.equal("20"); // fail; actual output: "20,0"

I assume I'm not asking for something that your tool cannot do, but the documentation fails to explain the formatting strings. I do not understand what the various symbols (# vs 0) mean and how to use them to achieve what I need.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions