/**
 * Format a number as a string with comma separation.
 *
 *
 * @param {number} n
 * @returns {string}
 */
const formatNumber = function formatNumber(n, options = {}) {
  const {
    locale = 'en-US',
    ...toLocaleStringOpts
  } = options;
  if (typeof n !== 'number') return undefined;
  return n.toLocaleString(locale, toLocaleStringOpts);
};
export default formatNumber;