scurker / currency.js

A javascript library for handling currencies

Home Page:https://currency.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Internationalisation

Penn0r opened this issue · comments

Hi.
I was wondering if there was support for international currencies - as you know, some currencies have the symbol after the amount, others will have different fractional and thousand separators.

I know that I can specify the details for each currency manually, but I am asking if there is support perhaps for ISO4217 currency codes, so that we can provide 'USD' or 'EUR', and it would automtatically provide the correct formatting.

Current implementation: currency(1.23, { separator: " ", decimal: ",", symbol: "€" });

commented

There's an ongoing discussion in #212.

I had originally considered adding I18N support, but there's a lot of caveats and nuances to doing so. There's mixed support and some places you may have to polyfill. At this time I have no plans of adding currency codes as currency.js allows you to do basically whatever you want with the formatting to fit your needs.