osrec / currencyFormatter.js

A super simple currency formatting library
MIT License
635 stars 61 forks source link

Add missing ISO 4217 Codes #14

Closed swftvsn closed 6 years ago

swftvsn commented 6 years ago

The following changes are missing from the files: ISO 4217, change 1.1.2018 Mauritania: ouguija (new) (1 MRU [new ouguija] = 10 MRO) MRU, ISO change number 165 ISO 4217, change 1.1.2018 São Tomé ja Príncipe: dobra (new)(1 STN [new dobra] = 1 000 STD) STN, ISO change number 164 ISO 4217, change 1.7.2016 Belarusian Ruble (new) (1 BYN [new] = 10 000 BYR) BYN, ISO change number 161

Additional information: https://www.currency-iso.org/en/shared/amendments/iso-4217-amendment.html (Change 165) https://www.currency-iso.org/dam/isocy/downloads/dl_currency_iso_amendment_164.pdf https://www.currency-iso.org/dam/isocy/downloads/dl_currency_iso_amendment_161.pdf

osrec commented 6 years ago

Thanks for this. Before we go ahead and merge, can you confirm that BYN has the same format pattern as BYR please? Only asking because I understand that a redenomination took place, so wanted to confirm that decimal places were not affected.

swftvsn commented 6 years ago

If I understood correctly, it is currently formatted by default using locale 'be', which looks like it is formatted using 2 decimal places.

...
BYR: 'be',
...
be: { p: '#,##0.00 !', g: ' ', d: ',' },
be_BY: { h: 'be' },
...

At least this page lists BYN to have 2 decimal places: https://en.wikipedia.org/wiki/ISO_4217

That said, I'm not an expert on Belarusian currency, so am a bit unsure where to check? Can you give any pointers where to look?

osrec commented 6 years ago

We've verified against ISO 4217 - looks good. Will merge this in now :)