Mottie / javascript-number-formatter

Lightweight & Fast JavaScript Number Formatter
http://mottie.github.io/javascript-number-formatter/
MIT License
141 stars 37 forks source link

Mask with # as decimal is not working as expected #18

Closed Veoth closed 5 years ago

Veoth commented 5 years ago

Hi @Mottie , First thank you for the library which is really useful.

Among all the examples you supplied in the README, there is this one:

format( "#,##0.####", 1234567.890 ); // output: "1,234,567.89"

The actual output is "1,234,567.8900"

I believe this is a bug since the # should fill the decimal only if necessary.

Mottie commented 5 years ago

Hi @Veoth!

Thanks for reporting this problem! I'll get it fixed in the next release.