import { isNil } from './is.mjs';

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

export { formatNumberWithCommas };
//# sourceMappingURL=number.mjs.map
