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

Add currency precision parameter to renderCurrencyShort #19

Closed abugnais closed 8 years ago

abugnais commented 8 years ago

currently renderCurrencyShort has a fixed precision of 2 digits after the decimal point for all currencies example:

renderCurrencyShort(10, 'JPY', 'latin') will render 10.00 which is not correct since JPY does not support decimal digits according to ISO-4217, my suggestion is to add an extra parameter for precision to renderCurrency or add a precision value to each element in the currencies array and let it decide the number of decimal digits for each one.

mwoc commented 8 years ago

This got fixed with https://github.com/papandreou/inter/commit/b104ec8a479480426d4cfd8688857f60004da85e