Skip to content

Instantly share code, notes, and snippets.

@chinchang
Created May 24, 2020 07:59
Show Gist options
  • Save chinchang/b0060b23a51e65a69b2bcb4c3ef79ee8 to your computer and use it in GitHub Desktop.
Save chinchang/b0060b23a51e65a69b2bcb4c3ef79ee8 to your computer and use it in GitHub Desktop.
Formatting a number as currency
new Intl.NumberFormat(undefined, {
style: 'currency',
currency: 'INR'
}).format(23213)
//"₹23,213.00"
new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR'
}).format(23213)
//"23.213,00 €"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment