docs: function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent) {
      if (isPercent === void 0) { isPercent = false; }
      var formattedText = '';
      var isZero = false;
      if (!isFinite(value)) {
          formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
      }
      else {
          var parsedNumber = parseNumber(value);
          if (isPercent) {
              parsedNumber = toPercent(parsedNumber);
          }
          var minInt = pattern.minInt;
          var minFraction = pattern.minFrac;
          var maxFraction = pattern.maxFrac;
          if (digitsInfo) {
              var parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
              if (parts === null) {
                  throw new Error(digitsInfo + " is not a valid digit info");
              }
              var minIntPart = parts[1];
              var minFractionPart = parts[3];
              var maxFractionPart = parts[5];
              if (minIntPart != null) {
                  minInt = parseIntAutoRadix(minIntPart);
              }
              if (minFractionPart != null) {
                  minFraction = parseIntAutoRadix(minFractionPart);
              }
              if (maxFractionPart != null) {
                  maxFraction = parseIntAutoRadix(maxFractionPart);
              }
              else if (minFractionPart != null && minFraction > maxFraction) {
                  maxFraction = minFraction;
              }
          }
          roundNumber(parsedNumber, minFraction, maxFraction);
          var digits = parsedNumber.digits;
          var integerLen = parsedNumber.integerLen;
          var exponent = parsedNumber.exponent;
          var decimals = [];
          isZero = digits.every(function (d) { return !d; });
          // pad zeros for small numbers
          for (; integerLen < minInt; integerLen++) {
              digits.unshift(0);
          }
          // pad zeros for small numbers
          for (; integerLen < 0; integerLen++) {
              digits.unshift(0);
          }
          // extract decimals digits
          if (integerLen > 0) {
              decimals = digits.splice(integerLen, digits.length);
          }
          else {
              decimals = digits;
              digits = [0];
          }
          // format the integer digits with grouping separators
          var groups = [];
          if (digits.length >= pattern.lgSize) {
              groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));
          }
          while (digits.length > pattern.gSize) {
              groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));
          }
          if (digits.length) {
              groups.unshift(digits.join(''));
          }
          formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
          // append the decimal digits
          if (decimals.length) {
              formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');
          }
          if (exponent) {
              formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;
          }
      }
      if (value < 0 && !isZero) {
          formattedText = pattern.negPre + formattedText + pattern.negSuf;
      }
      else {
          formattedText = pattern.posPre + formattedText + pattern.posSuf;
      }
      return formattedText;
  }