Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.ibm.icu.text.DecimalFormatSymbols
DecimalFormat
to format
numbers. DecimalFormat
creates for itself an instance of
DecimalFormatSymbols
from its locale data. If you need to
change any of these symbols, you can get the
DecimalFormatSymbols
object from your DecimalFormat
and modify it.
This is an enhanced version of DecimalFormatSymbols
that
is based on the standard version in the JDK. New or changed functionality
is labeled
NEW.
Locale
, DecimalFormat
Constructor Summary | |
| |
| |
|
Method Summary | |
Object |
|
boolean |
|
Currency |
|
String |
|
char |
|
char |
|
String |
|
char |
|
String |
|
String |
|
Locale |
|
ULocale |
|
char |
|
char |
|
String |
|
char |
|
char |
|
char |
|
char |
|
char |
|
char |
|
ULocale |
|
char |
|
int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public DecimalFormatSymbols()
Create a DecimalFormatSymbols object for the default locale.
public DecimalFormatSymbols(Locale locale)
Create a DecimalFormatSymbols object for the given locale.
- Parameters:
locale
- the locale
public DecimalFormatSymbols(ULocale locale)
Create a DecimalFormatSymbols object for the given locale.
- Parameters:
locale
- the locale
public Object clone()
Standard override.
public boolean equals(Object obj)
Override equals.
public Currency getCurrency()
Returns the currency symbol, for JDK 1.4 compatibility only. ICU clients should use the Currency API directly.
- Returns:
- the currency used, or null
public String getCurrencySymbol()
Return the string denoting the local currency.
- Returns:
- the local currency String.
public char getDecimalSeparator()
Return the character used for decimal sign. Different for French, etc.
- Returns:
- the decimal character
public char getDigit()
Return the character used for a digit in a pattern.
- Returns:
- the digit pattern character
public String getExponentSeparator()
NEW Return the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
- Returns:
- the localized exponent symbol, used in localized patterns and formatted strings
- See Also:
setExponentSeparator(String)
public char getGroupingSeparator()
Return the character used for thousands separator. Different for French, etc.
- Returns:
- the thousands character
public String getInfinity()
Return the String used to represent infinity. Almost always left unchanged.
- Returns:
- the Infinity string
public String getInternationalCurrencySymbol()
Return the international string denoting the local currency.
- Returns:
- the international string denoting the local currency
public Locale getLocale()
Returns the locale for which this object was constructed.
- Returns:
- the locale for which this object was constructed
public final ULocale getLocale(ULocale.Type type)
Return the locale that was used to create this object, or null. This may may differ from the locale requested at the time of this object's creation. For example, if an object is created for locale en_US_CALIFORNIA, the actual data may be drawn from en (the actual locale), and en_US may be the most specific locale that exists (the valid locale). Note: This method will be implemented in ICU 3.0; ICU 2.8 contains a partial preview implementation. The * actual locale is returned correctly, but the valid locale is not, in most cases.
- Parameters:
type
- type of information requested, eitherULocale.VALID_LOCALE
orULocale.ACTUAL_LOCALE
.
- Returns:
- the information specified by type, or null if this object was not constructed from locale data.
- See Also:
ULocale
,ULocale.VALID_LOCALE
,ULocale.ACTUAL_LOCALE
public char getMinusSign()
Return the character used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSign to the positive format.
- Returns:
- the minus sign character
public char getMonetaryDecimalSeparator()
Return the monetary decimal separator.
- Returns:
- the monetary decimal separator character
public String getNaN()
Return the String used to represent NaN. Almost always left unchanged.
- Returns:
- the NaN String
public char getPadEscape()
NEW Return the character used to pad numbers out to a specified width. This is not the pad character itself; rather, it is the special pattern character preceding the pad character. In the pattern "*_#,##0", '*' is the pad escape, and '_' is the pad character.
- Returns:
- the character
public char getPatternSeparator()
Return the character used to separate positive and negative subpatterns in a pattern.
- Returns:
- the pattern separator character
public char getPerMill()
Return the character used for mille percent sign. Different for Arabic, etc.
- Returns:
- the mille percent character
public char getPercent()
Return the character used for percent sign. Different for Arabic, etc.
- Returns:
- the percent character
public char getPlusSign()
NEW Return the localized plus sign.
- Returns:
- the plus sign, used in localized patterns and formatted strings
- See Also:
setPlusSign(char)
,setMinusSign(char)
,getMinusSign()
public char getSignificantDigit()
Return the character used to represent a significant digit in a pattern.
- Returns:
- the significant digit pattern character
public ULocale getULocale()
Returns the locale for which this object was constructed.
- Returns:
- the locale for which this object was constructed
public char getZeroDigit()
Return the character used for zero. Different for Arabic, etc.
- Returns:
- the character
public int hashCode()
Override hashCode
public void setCurrency(Currency currency)
ICU does not use the DecimalFormatSymbols for the currency any more. This API is present for API compatibility only. This also sets the currency symbol attribute to the currency's symbol in the DecimalFormatSymbols' locale, and the international currency symbol attribute to the currency's ISO 4217 currency code.
- Parameters:
currency
- the new currency to be used
public void setCurrencySymbol(String currency)
Set the string denoting the local currency.
- Parameters:
currency
- the local currency String.
public void setDecimalSeparator(char decimalSeparator)
Set the character used for decimal sign. Different for French, etc.
- Parameters:
decimalSeparator
- the decimal character
public void setDigit(char digit)
Set the character used for a digit in a pattern.
- Parameters:
digit
- the digit pattern character
public void setExponentSeparator(String exp)
NEW Set the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
- Parameters:
exp
- the localized exponent symbol, used in localized patterns and formatted strings
- See Also:
getExponentSeparator()
public void setGroupingSeparator(char groupingSeparator)
Set the character used for thousands separator. Different for French, etc.
- Parameters:
groupingSeparator
- the thousands character
public void setInfinity(String infinity)
Set the String used to represent infinity. Almost always left unchanged.
- Parameters:
infinity
- the Infinity String
public void setInternationalCurrencySymbol(String currency)
Set the international string denoting the local currency.
- Parameters:
currency
- the international string denoting the local currency.
public void setMinusSign(char minusSign)
Set the character used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSign to the positive format.
- Parameters:
minusSign
- the minus sign character
public void setMonetaryDecimalSeparator(char sep)
Set the monetary decimal separator.
- Parameters:
sep
- the monetary decimal separator character
public void setNaN(String NaN)
Set the String used to represent NaN. Almost always left unchanged.
- Parameters:
NaN
- the NaN String
public void setPadEscape(char c)
NEW Set the character used to pad numbers out to a specified width. This is not the pad character itself; rather, it is the special pattern character preceding the pad character. In the pattern "*_#,##0", '*' is the pad escape, and '_' is the pad character.
public void setPatternSeparator(char patternSeparator)
Set the character used to separate positive and negative subpatterns in a pattern.
- Parameters:
patternSeparator
- the pattern separator character
public void setPerMill(char perMill)
Set the character used for mille percent sign. Different for Arabic, etc.
- Parameters:
perMill
- the mille percent character
public void setPercent(char percent)
Set the character used for percent sign. Different for Arabic, etc.
- Parameters:
percent
- the percent character
public void setPlusSign(char plus)
NEW Set the localized plus sign.
- Parameters:
plus
- the plus sign, used in localized patterns and formatted strings
- See Also:
getPlusSign()
,setMinusSign(char)
,getMinusSign()
public void setSignificantDigit(char sigDigit)
Set the character used to represent a significant digit in a pattern.
- Parameters:
sigDigit
- the significant digit pattern character
public void setZeroDigit(char zeroDigit)
Set the character used for zero.
- Parameters:
zeroDigit
- the zero character.