Javascript Number currencyFormat(fixed)

Description

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,");
}



PreviousNext

Related