Created
May 25, 2018 21:40
-
-
Save NeuTrix/d6df1bd329faa84cac344940ba1151db to your computer and use it in GitHub Desktop.
Simple number formatter for U.S. commas
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 numCom = (x) => { | |
| return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment