Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove trailing zeros for integer input OR improve documentation #19

Closed
mingos777 opened this issue Nov 13, 2018 · 3 comments
Closed

Remove trailing zeros for integer input OR improve documentation #19

mingos777 opened this issue Nov 13, 2018 · 3 comments
Labels

Comments

@mingos777
Copy link

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.

@Mottie Mottie closed this as completed in d8c9359 Nov 13, 2018
@Mottie
Copy link
Owner

Mottie commented Nov 13, 2018

Hi @mingos777!

Thanks for reporting this problem. It was not behaving as expected. Version 2.0.7 was just released and will now behave as expected.

@Mottie Mottie added the bug label Nov 13, 2018
@Mottie
Copy link
Owner

Mottie commented Nov 13, 2018

Also, let me know if the new "format symbols" section in the readme is sufficient.

@mingos777
Copy link
Author

I have confirmed that version 2.0.7 behaves as expected.
The new doc section makes formatting options clear, thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants