PluralFormat createPluralFormat(PluralRules.PluralType pluralType, String pattern) { return new PluralFormat(locale, pluralType, pattern, getDecimalFormat()); }
this.numberFormat = (DecimalFormat) ruleSet.owner.getDecimalFormat().clone(); this.numberFormat.applyPattern(description);
digit = ruleSet.parse(workText, workPos, 10).intValue(); if (lenientParse && workPos.getIndex() == 0) { Number n = ruleSet.owner.getDecimalFormat().parse(workText, workPos); if (n != null) { digit = n.intValue();
tempResult = ruleSet.parse(text, parsePosition, upperBound); if (lenientParse && !ruleSet.isFractionSet() && parsePosition.getIndex() == 0) { tempResult = ruleSet.owner.getDecimalFormat().parse(text, parsePosition);
/** * <strong style="font-family: helvetica; color: red;">NEW</strong> * Implement com.ibm.icu.text.NumberFormat: * Format a BigDecimal. * @stable ICU 2.0 */ @Override public StringBuffer format(com.ibm.icu.math.BigDecimal number, StringBuffer toAppendTo, FieldPosition pos) { if (MIN_VALUE.compareTo(number) >= 0 || MAX_VALUE.compareTo(number) <= 0) { // We're outside of our normal range that this framework can handle. // The DecimalFormat will provide more accurate results. return getDecimalFormat().format(number, toAppendTo, pos); } if (number.scale() == 0) { return format(number.longValue(), toAppendTo, pos); } return format(number.doubleValue(), toAppendTo, pos); }
if (number == Long.MIN_VALUE) { result.append(getDecimalFormat().format(Long.MIN_VALUE));