code: function formatNumber$1(pipe, locale, value, style, digits, currency, currencyAsSymbol) {
      if (currency === void 0) { currency = null; }
      if (currencyAsSymbol === void 0) { currencyAsSymbol = false; }
      if (value == null)
          return null;
      // Convert strings to numbers
      value = typeof value === 'string' && !isNaN(+value - parseFloat(value)) ? +value : value;
      if (typeof value !== 'number') {
          throw invalidPipeArgumentError(pipe, value);
      }
      var minInt;
      var minFraction;
      var maxFraction;
      if (style !== NumberFormatStyle.Currency) {
          // rely on Intl default for currency
          minInt = 1;
          minFraction = 0;
          maxFraction = 3;
      }
      if (digits) {
          var parts = digits.match(NUMBER_FORMAT_REGEXP);
          if (parts === null) {
              throw new Error(digits + " is not a valid digit info for number pipes");
          }
          if (parts[1] != null) { // min integer digits
              minInt = parseIntAutoRadix(parts[1]);
          }
          if (parts[3] != null) { // min fraction digits
              minFraction = parseIntAutoRadix(parts[3]);
          }
          if (parts[5] != null) { // max fraction digits
              maxFraction = parseIntAutoRadix(parts[5]);
          }
      }
      return NumberFormatter.format(value, locale, style, {
          minimumIntegerDigits: minInt,
          minimumFractionDigits: minFraction,
          maximumFractionDigits: maxFraction,
          currency: currency,
          currencyAsSymbol: currencyAsSymbol,
      });
  }
docs: @license
  Copyright Google Inc. All Rights Reserved.
  
  Use of this source code is governed by an MIT-style license that can be
  found in the LICENSE file at https://angular.io/license