javascript-number-formatter icon indicating copy to clipboard operation
javascript-number-formatter copied to clipboard

Failing at differently sized groups

Open rotsee opened this issue 6 years ago • 1 comments

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

rotsee avatar Feb 12 '19 08:02 rotsee

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. 😞

Mottie avatar Feb 12 '19 13:02 Mottie