Convert a currency code to the currency’s display name.

 To convert a currency code to the currency’s display name for the specific locale you can use Intl.Display Names by setting the type property to currency and got the display names of the currencies based on the provided locale.

const regionNames = new Intl.DisplayNames(
  ['en'], {type: 'currency'}
);

console.log(regionNames.of('USD')); // 👉️ "US Dollar"
console.log(regionNames.of('EUR')); // 👉️ "Euro"
console.log(regionNames.of('JPY')); // 👉️ "Japanese Yen"

Leave a comment

Your email address will not be published. Required fields are marked *