org.tbee.swing.text
Class PercentFormat
java.lang.Object
java.text.Format
java.text.NumberFormat
org.tbee.swing.text.PercentFormat
- All Implemented Interfaces:
- Serializable, Cloneable
public class PercentFormat
- extends NumberFormat
Render or parse a percentage.
Behaviour is slightly different from the formatter provided by Java.
E.g. typing a "%" is not mandatory
- Author:
- user
- See Also:
- Serialized Form
| Methods inherited from class java.text.NumberFormat |
clone, equals, format, format, format, getAvailableLocales, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode |
PercentFormat
public PercentFormat(Locale locale)
- Parameters:
locale -
PercentFormat
public PercentFormat()
setMinimumFractionDigits
public void setMinimumFractionDigits(int v)
- Overrides:
setMinimumFractionDigits in class NumberFormat
- Parameters:
v -
withMinimumFractionDigits
public PercentFormat withMinimumFractionDigits(int v)
setStripTrailingZeros
public void setStripTrailingZeros(boolean value)
- only has meaning when using a decimal format
getStripTrailingZeros
public boolean getStripTrailingZeros()
withStripTrailingZeros
public PercentFormat withStripTrailingZeros(boolean value)
format
public StringBuffer format(double number,
StringBuffer toAppendTo,
FieldPosition pos)
- Specified by:
format in class NumberFormat
format
public StringBuffer format(long number,
StringBuffer toAppendTo,
FieldPosition pos)
- Specified by:
format in class NumberFormat
parse
public Number parse(String source,
ParsePosition parsePosition)
- Specified by:
parse in class NumberFormat
Copyright © 2012 KnowledgePlaza. All Rights Reserved.