javascript-number-formatter
javascript-number-formatter copied to clipboard
Failing at differently sized groups
Thank you for a great library. There seem to be a bug for some numbers patterns with Indian style grouping (the default in Indian English, for instance):
> format("#,##,##0.###",2000000)
'2,000,000'
(Excepted: 20,00,000)
For reference, here's how it looks in Google Closure: https://github.com/google/closure-library/blob/master/closure/goog/i18n/numberformat.js#L892
Hi @rotsee!
Oops, yes... the library is only checking the size of the last group. It'll need to be refactored to format the Indian format grouping. Thanks for reporting the problem. I don't know when I'll have time to work on it. 😞