LoginSignup
4
3

More than 5 years have passed since last update.

数字->文字列 金額表示のカンマ挿入

Posted at

function setComma(from){
var to = from + '';
var tmp = "";
while (to != (tmp = to.replace(/^([+-]?\d+)(\d\d\d)/,"$1,$2"))){
to = tmp;
}
return to;
}

自作ではありません。拾い物です。
すみません、拾い先を忘れてしまいました。
メモと同時に制作者様のURLを知っている方がいらっしゃったら追記させてもらいたいので、教えていただけると幸いです。

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3