parse(string, error) {
    let result;
    let positivePrefix = this.positivePrefix();
    let negativePrefix = this.negativePrefix();
    let positiveSuffix = this.positiveSuffix();
    let negativeSuffix = this.negativeSuffix();

    if (this.isLenient()) {
      string = string.replace(/\s/g, '');
      positivePrefix = trim(positivePrefix);
      negativePrefix = trim(negativePrefix);
      positiveSuffix = trim(positiveSuffix);
      negativeSuffix = trim(negativeSuffix);
    }

    let zeroSymbol;
    let nullSymbol;
    let notANumberSymbol;
    let positiveInfinitySymbol;
    let negativeInfinitySymbol;
    let innerString;

    if ((zeroSymbol = this.zeroSymbol()) !== undefined && zeroSymbol !== null && string === zeroSymbol) {
      result = 0;
    } else if ((nullSymbol = this.nullSymbol()) !== undefined && nullSymbol !== null && string === nullSymbol) {
      result = null;
    } else if ((notANumberSymbol = this.notANumberSymbol()) !== undefined && notANumberSymbol !== null && string === notANumberSymbol) {
      result = NaN;
    } else if ((positiveInfinitySymbol = this.positiveInfinitySymbol()) !== undefined && positiveInfinitySymbol !== null && string === positiveInfinitySymbol) {
      result = Infinity;
    } else if ((negativeInfinitySymbol = this.negativeInfinitySymbol()) !== undefined && negativeInfinitySymbol !== null && string === negativeInfinitySymbol) {
      result = -Infinity;
    } else {
      const hasNegativePrefix = startsWith(negativePrefix, string);
      const hasNegativeSuffix = endsWith(negativeSuffix, string);
      if (hasNegativePrefix && (this.isLenient() || hasNegativeSuffix)) {
        innerString = string.slice(negativePrefix.length);
        if (hasNegativeSuffix) {
          innerString = innerString.slice(0, innerString.length - negativeSuffix.length);
        }
        result = this._parseAbsoluteValue(innerString, error);
        if (result !== undefined && result !== null) {
          result *= -1;
        }
      } else {
        const hasPositivePrefix = startsWith(positivePrefix, string);
        const hasPositiveSuffix = endsWith(positiveSuffix, string);
        if (this.isLenient() || (hasPositivePrefix && hasPositiveSuffix)) {
          innerString = string;
          if (hasPositivePrefix) {
            innerString = innerString.slice(positivePrefix.length);
          }
          if (hasPositiveSuffix) {
            innerString = innerString.slice(0, innerString.length - positiveSuffix.length);
          }
          result = this._parseAbsoluteValue(innerString, error);
        } else {
          if (typeof error === 'function') {
            error('number-formatter.invalid-format');
          }
          return null;
        }
      }
    }

    if (result !== undefined && result !== null) {
      const minimum = this.minimum();
      if (minimum !== undefined && minimum !== null && result < minimum) {
        if (typeof error === 'function') {
          error('number-formatter.out-of-bounds.below-minimum');
        }
        return null;
      }

      const maximum = this.maximum();
      if (maximum !== undefined && maximum !== null && result > maximum) {
        if (typeof error === 'function') {
          error('number-formatter.out-of-bounds.above-maximum');
        }
        return null;
      }
    }

    return result;
  }
Parses the given string according to the current formatting settings.
When parsing values with a guaranteed regular format you can simply
configure the formatter correctly and call this method. However, when
dealing with human input it is often useful to configure
{@link NumberFormatter#isLenient} to be true, allowing more leeway in what
may be parsed as a valid number.

@example

  var f = new FieldKit.NumberFormatter();
  f.parse('89'); // 89

@param {string} string
@param {function(string)} error
@returns {?number}