![]() We will be using the Intl.NumberFormat() method which takes in an argument of the language of the reader Intl.NumberFormat("en-us"), or if you leave it blank it will detect the language based no the browser, which is almost always what you want.Īnd as the second argument you pass it an options object. Make a function formatCurrency which will take in the amount and the currency and return a formatted number. We will use this really cool API called Number Format, and it knows how to handle currency formatting, which is really cool. Some currencies support cents, some do not. Money is New Zealand Dollars (NZD), or money in Indian Rupee (INR), may be formatted differently. Convert between all major global currencies, precious metals. ![]() The problem we have now is that it is not formatting it accordingly to what the locale is. Calculate live currency and foreign exchange rates with the free Xe Currency Converter.
0 Comments
Leave a Reply. |