javascript 세자리 수 마다 컴마찍기
2011. 8. 17. 17:56ㆍ99. 정리전 - IT/12. Javascript
<script language='javascript'>
String.prototype.number_format=function(){
return this.replace(/(\d)(?=(?:\d{3})+(?!\d))/g,'$1,');
}
var test=1000000000;
document.write(test.toString().number_format());
return this.replace(/(\d)(?=(?:\d{3})+(?!\d))/g,'$1,');
}
var test=1000000000;
document.write(test.toString().number_format());
</script>