数字に3桁毎カンマをつける
※ ただしstrはStringsじゃないとエラーになるよ。 str = str.replace(/(\d)(?=(\d\d\d)+$)/g, "$1,"); (""+str)