intl = false;
++i;
}
}
String s = null;
Currency currency = getCurrency();
if (currency != null) {
// plural name is only needed when pluralCount != null, which means
// when formatting currency plural names. For other cases,
// pluralCount == null, and plural names are not needed.
if (plural && pluralCount != null) {
boolean isChoiceFormat[] = new boolean[1];
s = currency.getName(symbols.getULocale(), Currency.PLURAL_LONG_NAME,
pluralCount, isChoiceFormat);
} else if (!intl) {
boolean isChoiceFormat[] = new boolean[1];
s = currency.getName(symbols.getULocale(), Currency.SYMBOL_NAME,
isChoiceFormat);
if (isChoiceFormat[0]) {
// Two modes here: If doFormat is false, we set up
// currencyChoice. If doFormat is true, we use the previously
// created currencyChoice to format the value in digitList.
if (!doFormat) {
// If the currency is handled by a ChoiceFormat, then
// we're not going to use the expanded
// patterns. Instantiate the ChoiceFormat and return.
if (currencyChoice == null) {
currencyChoice = new ChoiceFormat(s);
}
// We could almost return null or "" here, since the
// expanded affixes are almost not used at all in this
// situation. However, one method -- toPattern() -- still
// does use the expanded affixes, in order to set up a
// padding pattern. We use the CURRENCY_SIGN as a
// placeholder.
s = String.valueOf(CURRENCY_SIGN);
} else {
FieldPosition pos = new FieldPosition(0); // ignored
currencyChoice.format(digitList.getDouble(), buffer, pos);
continue;
}
}
} else {
s = currency.getCurrencyCode();
}
} else {
s = intl ? symbols.getInternationalCurrencySymbol() :
symbols.getCurrencySymbol();
}