Skip to content

Instantly share code, notes, and snippets.

@shigwata
Created March 17, 2015 06:03
Show Gist options
  • Select an option

  • Save shigwata/51b89a6ecb2bff8f2763 to your computer and use it in GitHub Desktop.

Select an option

Save shigwata/51b89a6ecb2bff8f2763 to your computer and use it in GitHub Desktop.
NumberFormat javascriptで数値にカンマの追加 http://www.lopple.jp/?p=241
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