NumberingSystem ns = NumberingSystem.getInstance(locale);
if ( ns != null && ns.getRadix() == 10 && !ns.isAlgorithmic()) {
zeroDigit = ns.getDescription().charAt(0);
}
CurrencyDisplayInfo info = CurrencyData.provider.getInstance(locale, true);
// Obtain currency data from the currency API. This is strictly
// for backward compatibility; we don't use DecimalFormatSymbols
// for currency data anymore.
String currname = null;
currency = Currency.getInstance(locale);
if (currency != null) {
intlCurrencySymbol = currency.getCurrencyCode();
boolean[] isChoiceFormat = new boolean[1];
currname = currency.getName(locale, Currency.SYMBOL_NAME, isChoiceFormat);
// If this is a ChoiceFormat currency, then format an
// arbitrary value; pick something != 1; more common.
currencySymbol = isChoiceFormat[0]
? new ChoiceFormat(currname).format(2.0)
: currname;
} else {
intlCurrencySymbol = "XXX";
currencySymbol = "\u00A4"; // 'OX' currency symbol
}
// Get currency pattern/separator overrides if they exist.
monetarySeparator = decimalSeparator;
monetaryGroupingSeparator = groupingSeparator;
Currency curr = Currency.getInstance(locale);
if (curr != null){
CurrencyFormatInfo fmtInfo = info.getFormatInfo(curr.getCurrencyCode());
if (fmtInfo != null) {
currencyPattern = fmtInfo.currencyPattern;
monetarySeparator = fmtInfo.monetarySeparator;
monetaryGroupingSeparator = fmtInfo.monetaryGroupingSeparator;
}
}
// Get currency spacing data.
currencySpcBeforeSym = new String[3];
currencySpcAfterSym = new String[3];
initSpacingInfo(info.getSpacingInfo());
}