Last active
March 12, 2020 17:02
-
-
Save ashour/44799fd3bc54817d382d169e12f8b7eb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| const number = 123456.78; | |
| const usFormatter = new Intl.NumberFormat("en-US"); | |
| console.log(usFormatter.format(number)); // => 123,456.78 (American format) | |
| const frenchFormatter = new Intl.NumberFormat("fr-FR"); | |
| console.log(frenchFormatter.format(number)); // => 123 456,78 (French format) | |
| const arabicFormatter = new Intl.NumberFormat("ar-AR"); | |
| console.log(arabicFormatter.format(number)); // => ١٢٣٬٤٥٦٫٧٨ (Arabic format) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment