0

I know I can use Intl.DisplayNames to get the singular form (e.g. US Dollar).

const currencyNameEnUs = new Intl.DisplayNames( 'en-US', { type: 'currency' } );
const currencyCode = 'USD';

console.log( currencyNameEnUs.of( currencyCode ) );
// Expected output: "US Dollar"

But, I don't know how to pluralize the result. How do I get "US Dollars"?

Scott
  • 45
  • 5
  • 2
    see [V8: Intl.DisplayNames](https://v8.dev/features/intl-displaynames) *'In languages that have distinct singular and plural forms, the currency names are singular. For plural forms, Intl.NumberFormat may be used.'* – pilchard Mar 03 '23 at 16:22
  • While this works, the formatting is not the same (e.g. title case vs. sentence case). And I would need to include an amount, and write a conditional statement for singular vs. plural output. – Scott Mar 03 '23 at 18:51

0 Answers0