Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Currency IRR minor digits incorrect #157

Open
miracle2k opened this issue Mar 14, 2016 · 6 comments
Open

Currency IRR minor digits incorrect #157

miracle2k opened this issue Mar 14, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@miracle2k
Copy link

Intl.js wants to format the Iranian Rial with two minor digits. It seems that is the information that ISO 4217 contains. I'm in Iran right now, and I don't believe this makes any sense. There shouldn't be any decimal digits on IRR. For what it's worth, the CLDR agrees with me.

@caridy caridy added the bug label Mar 15, 2016
@caridy caridy self-assigned this Mar 15, 2016
@caridy
Copy link
Collaborator

caridy commented Mar 15, 2016

@miracle2k can you provide more details? specifically, the exact configuration you're using, the input and the output from the polyfill, and the output from chrome/ff and co.

@miracle2k
Copy link
Author

In Chrome:

new Intl.NumberFormat('en', {currency: 'IRR', style: 'currency'}).format(10000)
"IRR10,000"

Intl.js:
"IRR10,000.00"

@caridy
Copy link
Collaborator

caridy commented Mar 15, 2016

Firefox:

new Intl.NumberFormat('en', {currency: 'IRR', style: 'currency'}).format(10000)
"IRR10,000.00"

@caridy
Copy link
Collaborator

caridy commented Mar 15, 2016

certainly we don't have such information when formatting a number for en locale. Can you link to the CLDR details?

/cc @srl295

@srl295
Copy link

srl295 commented Mar 15, 2016

@caridy locale doesn't determine that aspect. The data should be looked up according to the currency code, irrespective of language. CLDR data for IRR = 0 decimal digits

Update: looks like there's a fixed list at https://github.com/andyearnshaw/Intl.js/blob/master/src/11.numberformat.js#L39 - this should be pulled from CLDR instead probably?

@caridy
Copy link
Collaborator

caridy commented Mar 16, 2016

Perfect, I will get this fix for next release.

@caridy caridy added this to the v1.3 milestone May 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants