问题
is there any way to get the ISO 4217 currency code for a locale? I'm using Angular. They have a utility function getLocaleCurrencyName()
to retrieve the name like euro
, US dollar
etc. but not the currency code like EUR
, USD
etc. Any idea?
回答1:
Try getLocalCurrencySymbol(): https://pr18487-aedf0aa.ngbuilds.io/api/common/getLocaleCurrencySymbol
Note that '$' is not a currency code, it is a currency symbol. USD, CAD, AUD are a few currency codes for currencies that have the symbol '$'.
来源:https://stackoverflow.com/questions/48380213/is-it-possible-to-get-an-iso-4217-currency-code-from-angular-or-javascript