JavaScript › Date, Time & Internationalization (Intl API)

How do you format numbers and currency for a locale using Intl.NumberFormat?

Intermediate

Answer

Intl.NumberFormat handles locale-aware digit grouping, decimal separators, and currency symbols automatically, avoiding manual and error-prone string manipulation.
const price = new Intl.NumberFormat('de-DE', {
  style: 'currency', currency: 'EUR'
}).format(1234.5);
console.log(price); // '1.234,50 €'
Real-world example Displaying product prices correctly formatted for a user's detected region.

Common follow-ups: How would you format a large number with abbreviations like '1.2K'?