Format numbers correctly for any locale โ€” no npm package needed ๐ŸŒ

`Intl.NumberFormat` handles currencies, percentages, units, and compact notation.

new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(1234.5)
// "$1,234.50"

Learn more ๐Ÿ‘‡
developer.mozilla.org/en-US/do

0

If you have a fediverse account, you can quote this note from your own instance. Search https://mastodon.social/users/mdn/statuses/116246525785622037 on your instance and quote it. (Note that quoting is not supported in Mastodon.)