org.tbee.swing.text
Class CurrencyFormat
java.lang.Object
java.text.Format
java.text.NumberFormat
org.tbee.swing.text.CurrencyFormat
- All Implemented Interfaces:
- Serializable, Cloneable
public class CurrencyFormat
- extends NumberFormat
Render or parse a currency.
Behaviour is slightly different from the formatter provided by Java.
There is no need to actually type the currency before the number
- Author:
- user
- See Also:
- Serialized Form
| Methods inherited from class java.text.NumberFormat |
clone, equals, format, format, format, getAvailableLocales, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode |
CURRENCY_PROPERTY_ID
public static final String CURRENCY_PROPERTY_ID
- See Also:
- Constant Field Values
SHOWCURRENCY_PROPERTY_ID
public static final String SHOWCURRENCY_PROPERTY_ID
- See Also:
- Constant Field Values
CurrencyFormat
public CurrencyFormat()
CurrencyFormat
public CurrencyFormat(Locale locale)
- Parameters:
locale -
CurrencyFormat
public CurrencyFormat(Currency currency)
- Parameters:
locale -
CurrencyFormat
public CurrencyFormat(String currencyCode)
- Parameters:
locale -
CurrencyFormat
public CurrencyFormat(NumberFormat currencyFormat,
NumberFormat numberFormat)
- Parameters:
currencyFormat - numberFormat -
getCurrency
public Currency getCurrency()
- Currency:
- Overrides:
getCurrency in class NumberFormat
setCurrency
public void setCurrency(Currency value)
- Overrides:
setCurrency in class NumberFormat
withCurrency
public CurrencyFormat withCurrency(Currency value)
getShowCurrency
public boolean getShowCurrency()
- ShowCurrency:
setShowCurrency
public void setShowCurrency(boolean value)
withShowCurrency
public CurrencyFormat withShowCurrency(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)
- first try the currency formatter, if it fails try the number formatter
- Specified by:
parse in class NumberFormat
Copyright © 2011 KnowledgePlaza. All Rights Reserved.