formatNumber(value, options) {
    // Set some options to map it closer to our old defaults
    let opts = options;
    let val = value;
    const usedLocale = opts?.locale || this.state.localeName;
    if (!opts) {
      opts = {};
    }

    if (opts?.minimumFractionDigits === undefined && !opts?.maximumFractionDigits) {
      opts.minimumFractionDigits = 2;
    }

    if (opts?.group || opts.group === '') {
      opts.useGrouping = opts.group !== '';
    }

    if (opts?.style === 'integer') {
      opts.style = undefined;
      opts.maximumFractionDigits = 0;
      opts.minimumFractionDigits = 0;
    }

    if (typeof value === 'string') {
      val = this.parseNumber(value, opts);
    }

    // Handle Big Int (integers)
    if (typeof value === 'string'
      && value.length >= 18
      && value.indexOf('.') === -1
      && value.indexOf(',') === -1) {
      return BigInt(value).toLocaleString(usedLocale, opts);
    }

    // Handle Big Int (decimals)
    if (typeof value === 'string'
    && value.length >= 18
    && (value.indexOf('.') > -1)) {
      const index = value.indexOf('.');
      let decimalPart = value.substr(index);
      const intPart = value.substr(0, index);
      const bigInt = BigInt(intPart).toLocaleString(usedLocale);
      decimalPart = Number(decimalPart).toLocaleString(usedLocale, opts);
      return bigInt + decimalPart.substr(1);
    }
    return Number(val).toLocaleString(usedLocale, opts);
  }
/**
   * Format a number using the locale information
   * @param {string} value the starting locale string
   * @param {object} [options] the objects to use for formatting
   * @returns {string} the formatted number
   */
Format a number using the locale information
@param {string} value the starting locale string
@param {object} [options] the objects to use for formatting
@returns {string} the formatted number
Format a number using the locale information @param { string } value the starting locale string @param { object } [ options ] the objects to use for formatting @returns { string } the formatted number
formatNumber(value, options) {
    let opts = options;
    let val = value;
    const usedLocale = opts?.locale || this.state.localeName;
    if (!opts) {
      opts = {};
    }
    if (opts?.minimumFractionDigits === undefined && !opts?.maximumFractionDigits) {
      opts.minimumFractionDigits = 2;
    }
    if (opts?.group || opts.group === '') {
      opts.useGrouping = opts.group !== '';
    }
    if (opts?.style === 'integer') {
      opts.style = undefined;
      opts.maximumFractionDigits = 0;
      opts.minimumFractionDigits = 0;
    }
    if (typeof value === 'string') {
      val = this.parseNumber(value, opts);
    }
    if (typeof value === 'string'
      && value.length >= 18
      && value.indexOf('.') === -1
      && value.indexOf(',') === -1) {
      return BigInt(value).toLocaleString(usedLocale, opts);
    }
    if (typeof value === 'string'
    && value.length >= 18
    && (value.indexOf('.') > -1)) {
      const index = value.indexOf('.');
      let decimalPart = value.substr(index);
      const intPart = value.substr(0, index);
      const bigInt = BigInt(intPart).toLocaleString(usedLocale);
      decimalPart = Number(decimalPart).toLocaleString(usedLocale, opts);
      return bigInt + decimalPart.substr(1);
    }
    return Number(val).toLocaleString(usedLocale, opts);
  }
formatNumber ( value , options ) { let opts = options ; let val = value ; const usedLocale = opts ?. locale || this . state . localeName ; if ( ! opts ) { opts = { } ; } if ( opts ?. minimumFractionDigits === undefined && ! opts ?. maximumFractionDigits ) { opts . minimumFractionDigits = 2 ; } if ( opts ?. group || opts . group === '' ) { opts . useGrouping = opts . group !== '' ; } if ( opts ?. style === 'integer' ) { opts . style = undefined ; opts . maximumFractionDigits = 0 ; opts . minimumFractionDigits = 0 ; } if ( typeof value === 'string' ) { val = this . parseNumber ( value , opts ) ; } if ( typeof value === 'string' && value . length >= 18 && value . indexOf ( '.' ) === - 1 && value . indexOf ( ',' ) === - 1 ) { return BigInt ( value ) . toLocaleString ( usedLocale , opts ) ; } if ( typeof value === 'string' && value . length >= 18 && ( value . indexOf ( '.' ) > - 1 ) ) { const index = value . indexOf ( '.' ) ; let decimalPart = value . substr ( index ) ; const intPart = value . substr ( 0 , index ) ; const bigInt = BigInt ( intPart ) . toLocaleString ( usedLocale ) ; decimalPart = Number ( decimalPart ) . toLocaleString ( usedLocale , opts ) ; return bigInt + decimalPart . substr ( 1 ) ; } return Number ( val ) . toLocaleString ( usedLocale , opts ) ; }
Format a number using the locale information
 @param {string} value the starting locale string
 @param {object} [options] the objects to use for formatting
 @returns {string} the formatted number
Format a number using the locale information @param { string } value the starting locale string @param { object } [ options ] the objects to use for formatting @returns { string } the formatted number
// Set some options to map it closer to our old defaults // Handle Big Int (integers) // Handle Big Int (decimals)