Created
May 24, 2020 07:59
-
-
Save chinchang/b0060b23a51e65a69b2bcb4c3ef79ee8 to your computer and use it in GitHub Desktop.
Formatting a number as currency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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