parseNumber(input, options) {
    const localeData = this.loadedLocales.get(options?.locale || this.locale.name);
    const numSettings = localeData.numbers;
    let numString = input;

    if (!numString) {
      return NaN;
    }

    if (typeof input === 'number') {
      numString = numString.toString();
    }

    const group = options?.group ? options.group : numSettings.group;
    const decimal = options?.decimal ? options.decimal : numSettings.decimal;
    const percentSign = options?.percentSign ? options.percentSign : numSettings.percentSign;
    const currencySign = options?.currencySign ? options.currencySign : localeData.currencySign;

    const exp = (group === ' ') ? new RegExp(/\s/g) : new RegExp(`\\${group}`, 'g');
    numString = numString.replace(exp, '');
    numString = numString.replace(decimal, '.');
    numString = numString.replace(percentSign, '');
    numString = numString.replace(currencySign, '');
    numString = numString.replace('$', '');
    numString = numString.replace(' ', '');

    if (numString.indexOf('.') === -1 && numString.length >= 18) {
      return numString;
    }
    return numString.length >= 19 ? numString : parseFloat(numString);
  }
/**
   * Takes a locale formatted number string and converts it back to a real number object.
   * @param {string} input  The source number normally as a string.
   * @param {object} options Any special options to pass in such as the original locale
   * @returns {number} The number as an actual Number type unless the number
   * is a big int (19 significant digits), in this case a string will be returned
   */
Takes a locale formatted number string and converts it back to a real number object.
@param {string} input  The source number normally as a string.
@param {object} options Any special options to pass in such as the original locale
@returns {number} The number as an actual Number type unless the number
is a big int (19 significant digits), in this case a string will be returned
Takes a locale formatted number string and converts it back to a real number object . @param { string } input The source number normally as a string . @param { object } options Any special options to pass in such as the original locale @returns { number } The number as an actual Number type unless the number is a big int ( 19 significant digits ) in this case a string will be returned
parseNumber(input, options) {
    const localeData = this.loadedLocales.get(options?.locale || this.locale.name);
    const numSettings = localeData.numbers;
    let numString = input;
    if (!numString) {
      return NaN;
    }
    if (typeof input === 'number') {
      numString = numString.toString();
    }
    const group = options?.group ? options.group : numSettings.group;
    const decimal = options?.decimal ? options.decimal : numSettings.decimal;
    const percentSign = options?.percentSign ? options.percentSign : numSettings.percentSign;
    const currencySign = options?.currencySign ? options.currencySign : localeData.currencySign;
    const exp = (group === ' ') ? new RegExp(/\s/g) : new RegExp(`\\${group}`, 'g');
    numString = numString.replace(exp, '');
    numString = numString.replace(decimal, '.');
    numString = numString.replace(percentSign, '');
    numString = numString.replace(currencySign, '');
    numString = numString.replace('$', '');
    numString = numString.replace(' ', '');
    if (numString.indexOf('.') === -1 && numString.length >= 18) {
      return numString;
    }
    return numString.length >= 19 ? numString : parseFloat(numString);
  }
parseNumber ( input , options ) { const localeData = this . loadedLocales . get ( options ?. locale || this . locale . name ) ; const numSettings = localeData . numbers ; let numString = input ; if ( ! numString ) { return NaN ; } if ( typeof input === 'number' ) { numString = numString . toString ( ) ; } const group = options ?. group ? options . group : numSettings . group ; const decimal = options ?. decimal ? options . decimal : numSettings . decimal ; const percentSign = options ?. percentSign ? options . percentSign : numSettings . percentSign ; const currencySign = options ?. currencySign ? options . currencySign : localeData . currencySign ; const exp = ( group === ' ' ) ? new RegExp ( / \s / g ) : new RegExp ( ` \\ ${ group } ` , 'g' ) ; numString = numString . replace ( exp , '' ) ; numString = numString . replace ( decimal , '.' ) ; numString = numString . replace ( percentSign , '' ) ; numString = numString . replace ( currencySign , '' ) ; numString = numString . replace ( '$' , '' ) ; numString = numString . replace ( ' ' , '' ) ; if ( numString . indexOf ( '.' ) === - 1 && numString . length >= 18 ) { return numString ; } return numString . length >= 19 ? numString : parseFloat ( numString ) ; }
Takes a locale formatted number string and converts it back to a real number object.
Takes a locale formatted number string and converts it back to a real number object .