function toReadableNumber(str){
var ret = Math.floor(str).toString();
ret = ret.match(/./g).reverse().join("");
ret = ret.replace(/(\d{3})/g,"$1,");
ret = ret.match(/./g).reverse().join("").replace(/^,/,"");
return ret;
}
Reference
きんがくとかをけたくぎりhttp://page.freett.com/elledia/tips/comma.html