}
return decimalFormat;
}
private DecimalFormat getDecimalFormat(Locale locale) {
DecimalFormat decimalFormat = null;
switch (variant) {
case INTEGER:
decimalFormat = I18nSupport.getInstance().getIntegerFormat(locale);
break;
case NUMBER:
decimalFormat = I18nSupport.getInstance().getNumberFormat(locale);
break;
case CURRENCY:
decimalFormat = I18nSupport.getInstance().getCurrencyFormat(locale);
break;
case PERCENT:
decimalFormat = I18nSupport.getInstance().getPercentFormat(locale);
break;
}
String pattern = (String)localizedPatterns.get(locale);
if (pattern != null) {
decimalFormat.applyLocalizedPattern(pattern);
} else if (nonLocalizedPattern != null) {
decimalFormat.applyPattern(nonLocalizedPattern);
}
return decimalFormat;
}