<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>