code: function (number, decimals, decPoint, thousandsSep) {
  
              number = ("" + number).replace(/[^0-9+\-Ee.]/g, "");
  
              var num        = !isFinite(+number) ? 0 : +number,
                  prec       = !isFinite(+decimals) ? 0 : Math.abs(decimals),
                  separator  = thousandsSep === undefined ? "," : thousandsSep,
                  decimal    = decPoint === undefined ? "." : decPoint,
                  toFixedFix = function (n, prec) {
                      var k = Math.pow(10, prec);
                      return "" + (Math.round(n * k) / k).toFixed(prec);
                  },
  
                  // Fix for IE parseFloat(0.55).toFixed(0) = 0;
                  result     = (prec ? toFixedFix(num, prec) : "" + Math.round(num)).split(".");
  
              if (result[0].length > 3) {
                  result[0] = result[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, separator);
              }
  
              return result.join(decimal);
          }
docs: Format a number with grouped thousands
  @link http://phpjs.org/functions/number_format/
  
  @param number
  @param decimals
  @param decPoint
  @param thousandsSep
  @returns {string}