Format a number as currency
JavascriptIntl handles the symbol, the separators and the decimal places for the locale, so you never hand-roll them.
const gbp = new Intl.NumberFormat('en-GB', {
style: 'currency',
currency: 'GBP',
});
gbp.format(1234.5); // '£1,234.50'