function formatNumber(input = 0, currencyCode = '', neutral = false) {
  if (!is.number(input)) {
    return input;
  }

  if (!currencyCode) {
    return new Intl.NumberFormat(navigator.language).format(input);
  }

  const lang = neutral ? navigator.language.split('-')[0] : navigator.language;

  return new Intl.NumberFormat(lang, {
    style: 'currency',
    currency: currencyCode,
  }).format(input);
}
/**
 * Format a number into a localised format
 *
 * @param {Number} input
 * @param {String} currencyCode - The ISO currency code
 */
Format a number into a localised format
@param {Number} input
@param {String} currencyCode - The ISO currency code
Format a number into a localised format @param { Number } input @param { String } currencyCode - The ISO currency code
function formatNumber(input = 0, currencyCode = '', neutral = false) {
  if (!is.number(input)) {
    return input;
  }
  if (!currencyCode) {
    return new Intl.NumberFormat(navigator.language).format(input);
  }
  const lang = neutral ? navigator.language.split('-')[0] : navigator.language;
  return new Intl.NumberFormat(lang, {
    style: 'currency',
    currency: currencyCode,
  }).format(input);
}
function formatNumber ( input = 0 , currencyCode = '' , neutral = false ) { if ( ! is . number ( input ) ) { return input ; } if ( ! currencyCode ) { return new Intl . NumberFormat ( navigator . language ) . format ( input ) ; } const lang = neutral ? navigator . language . split ( '-' ) [ 0 ] : navigator . language ; return new Intl . NumberFormat ( lang , { style : 'currency' , currency : currencyCode , } ) . format ( input ) ; }
Format a number into a localised format
 @param {Number} input
 @param {String} currencyCode - The ISO currency code
Format a number into a localised format @param { Number } input @param { String } currencyCode - The ISO currency code