Posted By

rg443 on 07/21/12


Tagged

javascript number format group digitsprototype


Versions (?)

format numbers in javascript with group digits


 / Published in: JavaScript
 

format numbers in javascript with group digits

  1. Number.prototype.format = function () {
  2. return this.toString().split( /(?=(?:\d{3})+(?:\.|$))/g ).join( "," );
  3. };

Report this snippet  

You need to login to post a comment.