code: function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
      var format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
      var pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
      pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
      pattern.maxFrac = pattern.minFrac;
      var res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
      return res
          .replace(CURRENCY_CHAR, currency)
          // if we have 2 time the currency character, the second one is ignored
          .replace(CURRENCY_CHAR, '');
  }
docs: @ngModule CommonModule
  @description
  
  Formats a number as currency using locale rules.
  
  Use `currency` to format a number as currency.
  
  Where:
  - `value` is a number.
  - `locale` is a `string` defining the locale to use.
  - `currency` is the string that represents the currency, it can be its symbol or its name.
  - `currencyCode` is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, such
  as `USD` for the US dollar and `EUR` for the euro.
  - `digitInfo` See {@link DecimalPipe} for more details.