private void appendNumber(StringBuffer buffer, int count, int value) { // TODO: we could avoid using the NumberFormat in most cases for a significant speedup. // The only problem is that we expose the NumberFormat to third-party code, so we'd have // some work to do to work out when the optimization is valid. int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits(); numberFormat.setMinimumIntegerDigits(count); numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0)); numberFormat.setMinimumIntegerDigits(minimumIntegerDigits); }
setMinimumIntegerDigits(super.getMinimumIntegerDigits()); setMaximumFractionDigits(super.getMaximumFractionDigits()); setMinimumFractionDigits(super.getMinimumFractionDigits());
StringBuilder buf = new StringBuilder(); buf.append(currencyLeft); int minimumIntegerDigits = currencyFormat.getMinimumIntegerDigits(); for (int i = Math.max(minimumIntegerDigits, 4) - 1; i >= 0; --i) { buf.append(i < minimumIntegerDigits ? '0' : '#');
/** * Returns the minimum number of digits allowed in the integer portion of a * number. The default value is 1, which subclasses can override. * When formatting, if this value is not reached, numbers are padded on the * left with the locale-specific '0' character to ensure at least this * number of integer digits. When parsing, this has no effect. * @return the minimum number of integer digits * @see #setMinimumIntegerDigits * @stable ICU 2.0 */ public int getMinimumIntegerDigits() { return numberFormat.getMinimumIntegerDigits(); }
public int getMinumumIntegerDigits() { return fJdkNfmt.getMinimumIntegerDigits(); }
/** * Returns the minimum number of digits allowed in the integer portion of a * number. The default value is 1, which subclasses can override. * When formatting, if this value is not reached, numbers are padded on the * left with the locale-specific '0' character to ensure at least this * number of integer digits. When parsing, this has no effect. * @return the minimum number of integer digits * @see #setMinimumIntegerDigits * @stable ICU 2.0 */ public int getMinimumIntegerDigits() { return numberFormat.getMinimumIntegerDigits(); }
private void appendNumber(StringBuffer buffer, int count, int value) { // TODO: we could avoid using the NumberFormat in most cases for a significant speedup. // The only problem is that we expose the NumberFormat to third-party code, so we'd have // some work to do to work out when the optimization is valid. int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits(); numberFormat.setMinimumIntegerDigits(count); numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0)); numberFormat.setMinimumIntegerDigits(minimumIntegerDigits); }
private void appendNumber(StringBuffer buffer, int count, int value) { // TODO: we could avoid using the NumberFormat in most cases for a significant speedup. // The only problem is that we expose the NumberFormat to third-party code, so we'd have // some work to do to work out when the optimization is valid. int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits(); numberFormat.setMinimumIntegerDigits(count); numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0)); numberFormat.setMinimumIntegerDigits(minimumIntegerDigits); }
private void appendNumber(StringBuffer buffer, int count, int value) { // TODO: we could avoid using the NumberFormat in most cases for a significant speedup. // The only problem is that we expose the NumberFormat to third-party code, so we'd have // some work to do to work out when the optimization is valid. int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits(); numberFormat.setMinimumIntegerDigits(count); numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0)); numberFormat.setMinimumIntegerDigits(minimumIntegerDigits); }
private void appendNumber(StringBuffer buffer, int count, int value) { // TODO: we could avoid using the NumberFormat in most cases for a significant speedup. // The only problem is that we expose the NumberFormat to third-party code, so we'd have // some work to do to work out when the optimization is valid. int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits(); numberFormat.setMinimumIntegerDigits(count); numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0)); numberFormat.setMinimumIntegerDigits(minimumIntegerDigits); }
private void appendNumber(StringBuffer buffer, int count, int value) { // TODO: we could avoid using the NumberFormat in most cases for a significant speedup. // The only problem is that we expose the NumberFormat to third-party code, so we'd have // some work to do to work out when the optimization is valid. int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits(); numberFormat.setMinimumIntegerDigits(count); numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0)); numberFormat.setMinimumIntegerDigits(minimumIntegerDigits); }
private void appendNumber(StringBuffer buffer, int count, int value) { // TODO: we could avoid using the NumberFormat in most cases for a significant speedup. // The only problem is that we expose the NumberFormat to third-party code, so we'd have // some work to do to work out when the optimization is valid. int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits(); numberFormat.setMinimumIntegerDigits(count); numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0)); numberFormat.setMinimumIntegerDigits(minimumIntegerDigits); }
@Override public String toString() { final NumberFormat format = _format.get(); final int minValueDigit = format.getMinimumIntegerDigits(); final int minFractionDigit = format.getMinimumFractionDigits(); final int maxFractionDigit = format.getMaximumFractionDigits(); final StringBuilder out = new StringBuilder(); for (int i = 0; i < minValueDigit; ++i) { out.append(_field.type()); } if (minFractionDigit != 0 || maxFractionDigit != 0) { out.append('.'); } for (int i = 0; i < minFractionDigit; ++i) { out.append(_field.type()); } return out.toString(); }
format.getMinimumIntegerDigits()); int digits = Math.min(format.getMaximumFractionDigits(), MAXIMUM_DIGITS); if (format instanceof DecimalFormat) {
@Override public boolean equals(Object obj) { if (obj == null) return false; if (this == obj) return true; if (getClass() != obj.getClass()) return false; NumberFormat that = (NumberFormat) obj; return ( getMaximumIntegerDigits() == that.getMaximumIntegerDigits() && getMinimumIntegerDigits() == that.getMinimumIntegerDigits() && getMaximumFractionDigits() == that.getMaximumFractionDigits() && getMinimumFractionDigits() == that.getMinimumFractionDigits() && isGroupingUsed() == that.isGroupingUsed() && isParseIntegerOnly() == that.isParseIntegerOnly() ); }
if (formatLong) { maxIntDigits = super.getMaximumIntegerDigits(); minIntDigits = super.getMinimumIntegerDigits(); maxFraDigits = super.getMaximumFractionDigits(); minFraDigits = super.getMinimumFractionDigits();
setMinimumIntegerDigits(super.getMinimumIntegerDigits()); setMaximumFractionDigits(super.getMaximumFractionDigits()); setMinimumFractionDigits(super.getMinimumFractionDigits());
setMinimumIntegerDigits(super.getMinimumIntegerDigits()); setMaximumFractionDigits(super.getMaximumFractionDigits()); setMinimumFractionDigits(super.getMinimumFractionDigits());
setMinimumIntegerDigits(super.getMinimumIntegerDigits()); setMaximumFractionDigits(super.getMaximumFractionDigits()); setMinimumFractionDigits(super.getMinimumFractionDigits());
setMinimumIntegerDigits(super.getMinimumIntegerDigits()); setMaximumFractionDigits(super.getMaximumFractionDigits()); setMinimumFractionDigits(super.getMinimumFractionDigits());