JS Built-ins
IntlNumberFormatintermediate

Format as currency

πŸ“– Usage Example
new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(1234.5);
// '$1,234.50'

Use the currency style to format monetary values with the correct symbol.

Use Intl.NumberFormat with currency style.

πŸ’‘ Hints (1)
  • β€’ Use style: "currency" and currency: "USD"