Javascript Number currencyFormat(fixed)
Number.prototype.currencyFormat=function(fixed){ var fixed=fixed||0; var str=this.toFixed(fixed); return str.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$1,"); }