How to format numbers as currency strings
Intl.NumberFormat JavaScript has a number formatter (part of the Internationalization API). Use undefined in place of the first argument (‘en-US’ in the example) to use the system locale (the user locale in case the code is running in a browser). Further explanation of the locale code. Here’s a list of the currency codes. Intl.NumberFormat vs Number.prototype.toLocaleString A final note comparing … Read more