'use strict';

var is = require('./is.js');

function formatNumberWithCommas(number) {
  if (is.isNil(number) || Number.isNaN(Number(number))) {
    return number;
  }
  return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}

exports.formatNumberWithCommas = formatNumberWithCommas;
//# sourceMappingURL=number.js.map
