Localized prices with Intl.NumberFormat

Widely available Reference ↗

Currency separators, symbol placement, and decimal rules vary by locale. Let the internationalization API format the value instead of concatenating strings.

const price = new Intl.NumberFormat('it-IT', {
  style: 'currency',
  currency: 'EUR',
});

price.format(1234.5); // 1.234,50 €  

The locale controls presentation; the currency controls monetary meaning. Store amounts as numbers or minor units, not as already-formatted text.