Class DecimalFormatSymbols

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.

Constructor Detail

DecimalFormatSymbols

public DecimalFormatSymbols()

Create a DecimalFormatSymbols object for the default
FORMAT locale.
This constructor can only construct instances for the locales
supported by the Java runtime environment, not for those
supported by installed
DecimalFormatSymbolsProvider
implementations. For full locale coverage, use the
getInstance method.

DecimalFormatSymbols

Create a DecimalFormatSymbols object for the given locale.
This constructor can only construct instances for the locales
supported by the Java runtime environment, not for those
supported by installed
DecimalFormatSymbolsProvider
implementations. For full locale coverage, use the
getInstance method.
If the specified locale contains the Locale.UNICODE_LOCALE_EXTENSION
for the numbering system, the instance is initialized with the specified numbering
system if the JRE implementation supports it. For example,

Method Detail

getAvailableLocales

Returns an array of all locales for which the
getInstance methods of this class can return
localized instances.
The returned array represents the union of locales supported by the Java
runtime and by installed
DecimalFormatSymbolsProvider
implementations. It must contain at least a Locale
instance equal to Locale.US.

Returns:

an array of locales for which localized
DecimalFormatSymbols instances are available.

Since:

1.6

getInstance

Gets the DecimalFormatSymbols instance for the default
locale. This method provides access to DecimalFormatSymbols
instances for locales supported by the Java runtime itself as well
as for those supported by installed
DecimalFormatSymbolsProvider implementations.

getInstance

Gets the DecimalFormatSymbols instance for the specified
locale. This method provides access to DecimalFormatSymbols
instances for locales supported by the Java runtime itself as well
as for those supported by installed
DecimalFormatSymbolsProvider implementations.
If the specified locale contains the Locale.UNICODE_LOCALE_EXTENSION
for the numbering system, the instance is initialized with the specified numbering
system if the JRE implementation supports it. For example,

setInternationalCurrencySymbol

Sets the ISO 4217 currency code of the currency of these
DecimalFormatSymbols.
If the currency code is valid (as defined by
Currency.getInstance),
this also sets the currency attribute to the corresponding Currency
instance and the currency symbol attribute to the currency's symbol
in the DecimalFormatSymbols' locale. If the currency code is not valid,
then the currency attribute is set to null and the currency symbol
attribute is not modified.

setCurrency

Sets the currency of these DecimalFormatSymbols.
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.