Java Doc for DecimalFormatSymbols.java in » Internationalization-Localization » icu4j » com » ibm » icu » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation
This class represents the set of symbols (such as the decimal separator, the
grouping separator, and so on) needed by 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. See Also:java.util.Locale See Also:DecimalFormat author: Mark Davis author: Alan Liu
Constructor Summary
public
DecimalFormatSymbols() Create a DecimalFormatSymbols object for the default locale.
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.
public char
getMinusSign() Return the character used to represent minus sign.
NEW
Return the string used to separate the mantissa from the exponent.
Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.
the localized exponent symbol, used in localized patternsand formatted strings See Also:DecimalFormatSymbols.setExponentSeparator
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).
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.
the minus sign character
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 throws: NullPointerException - if currency is null See Also:DecimalFormatSymbols.setCurrencySymbol See Also:DecimalFormatSymbols.setInternationalCurrencySymbol
setCurrencySymbol
public void setCurrencySymbol(String currency)(Code)
Set the string denoting the local currency.
Parameters: currency - the local currency String.
setDecimalSeparator
public void setDecimalSeparator(char decimalSeparator)(Code)
Set the character used for decimal sign. Different for French, etc.
Parameters: decimalSeparator - the decimal character
Set the character used for a digit in a pattern.
Parameters: digit - the digit pattern character
setExponentSeparator
public void setExponentSeparator(String exp)(Code)
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 patternsand formatted strings See Also:DecimalFormatSymbols.getExponentSeparator
setGroupingSeparator
public void setGroupingSeparator(char groupingSeparator)(Code)
Set the character used for thousands separator. Different for French, etc.
Parameters: groupingSeparator - the thousands character
Set information about the locales that were used to create this
object. If the object was not constructed from locale data,
both arguments should be set to null. Otherwise, neither
should be null. The actual locale must be at the same level or
less specific than the valid locale. This method is intended
for use by factories or other entities that create objects of
this class.
Parameters: valid - the most specific locale containing any resourcedata, or null Parameters: actual - the locale containing data used to construct thisobject, or null See Also:com.ibm.icu.util.ULocale See Also:com.ibm.icu.util.ULocale.VALID_LOCALE See Also:com.ibm.icu.util.ULocale.ACTUAL_LOCALE
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
setMonetaryDecimalSeparator
public void setMonetaryDecimalSeparator(char sep)(Code)
Set the monetary decimal separator.
Parameters: sep - the monetary decimal separator character
setMonetaryGroupingSeparator
public void setMonetaryGroupingSeparator(char sep)(Code)
Set the monetary decimal separator.
Parameters: sep - the monetary decimal separator character