Created
March 17, 2015 06:03
-
-
Save shigwata/51b89a6ecb2bff8f2763 to your computer and use it in GitHub Desktop.
NumberFormat javascriptで数値にカンマの追加 http://www.lopple.jp/?p=241
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
| var numberFormat = function(num) { | |
| return num.toString().replace(/^\d+[^\.]/, function(t) { | |
| return t.replace(/([\d]+?)(?=(?:\d{3})+$)/g, function(t) { | |
| return t + ','; | |
| }); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment