function numberWithCommas(number) {
  // http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript
  var parts = number.toString().split('.');

  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');

  return parts.join('.');
}
/**
* Adds commas as thousand seperators to a Number to increase readability.
*
* @param {Number|String} number - A Number or String literal representing a number.
* @return {String} - A string literal representaton of the number with commas seperating the thousands.
*/
Adds commas as thousand seperators to a Number to increase readability.
Adds commas as thousand seperators to a Number to increase readability .
function numberWithCommas(number) {
  var parts = number.toString().split('.');
  parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
  return parts.join('.');
}
function numberWithCommas ( number ) { var parts = number . toString ( ) . split ( '.' ) ; parts [ 0 ] = parts [ 0 ] . replace ( / \B(?=(\d{3})+(?!\d)) / g , ',' ) ; return parts . join ( '.' ) ; }
Adds commas as thousand seperators to a Number to increase readability.
Adds commas as thousand seperators to a Number to increase readability .
// http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript