papandreou / inter

A JavaScript locale library based on information extracted from the Unicode CLDR database
BSD 3-Clause "New" or "Revised" License
21 stars 5 forks source link

Missing renderCurrency method #7

Closed ragulka closed 8 years ago

ragulka commented 10 years ago

It seems that there is currently no currency rendering method? The patterns are available in CLDR and the implementation shouldn't be too hard to figure out either.

The syntax could look like this:

inter.load('en');
inter.renderCurrency( 10000.23, 'EUR' ); // €10,000.23
inter.renderCurrency( 10000.23, 'EUR', true ); // EUR10,000.23

The 2nd param is of course, the currency we want to see the results in. The 3rd param is borrowed from Google Closure's implementation where they let the user decide if they need a global or local representation of the currency symbol.

papandreou commented 10 years ago

Absolutely. Pull requests are welcome :)

mwoc commented 8 years ago

This has been implemented a while ago, as renderCurrencyShort and renderCurrencyLong