public function formatCurrencyNumber($number, Locale $locale, $currency, $formatLength = NumbersReader::FORMAT_LENGTH_DEFAULT, $currencyCode = null)
    {
        NumbersReader::validateFormatLength($formatLength);
        $parsedFormat = $this->numbersReader->parseFormatFromCldr($locale, NumbersReader::FORMAT_TYPE_CURRENCY, $formatLength);

        if ($currencyCode !== null) {
            // When currencyCode is set, maxDecimalDigits and rounding is overridden with CLDR data
            $currencyFraction = $this->currencyReader->getFraction($currencyCode);
            $parsedFormat['rounding'] = $currencyFraction['rounding'];
            $parsedFormat['maxDecimalDigits'] = $currencyFraction['digits'];
            $parsedFormat['minDecimalDigits'] = min($parsedFormat['minDecimalDigits'], $parsedFormat['maxDecimalDigits']);
        }

        return $this->doFormattingWithParsedFormat($number, $parsedFormat, $this->numbersReader->getLocalizedSymbolsForLocale($locale), $currency);
    }