APIdia Launch Partner
Top Description Fields Constructors Methods
java.text

public Class DecimalFormatSymbols

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Imports
java.io.InvalidObjectException, .IOException, .ObjectInputStream, .Serializable, java.text.spi.DecimalFormatSymbolsProvider, java.util.Currency, .Locale, .Objects, sun.util.locale.provider.CalendarDataUtility, .LocaleProviderAdapter, .LocaleServiceProviderPool, .ResourceBundleBasedAdapter

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.

The "rg" (region override), "nu" (numbering system), and "cu" (currency) Locale Unicode extensions are supported which may override values within the symbols. For both "nu" and "cu", if they are specified in addition to "rg" by the backing Locale, the respective values from the "nu" and "cu" extension supersede the implicit ones from the "rg" extension.

Authors
Mark Davis, Alan Liu
Since
1.1
See Also
java.util.Locale, DecimalFormat

Field Summary

Modifier and TypeField and Description
private transient Currency
private transient volatile boolean
private String
currencySymbol

String denoting the local currency, e.g. "$".

private static final int
private char
decimalSeparator

Character used for decimal sign.

private char
digit

Character used for a digit in a pattern.

private char
exponential

The character used to distinguish the exponent in a number formatted in exponential notation, e.g. 'E' for a number such as "1.23E45".

private String
exponentialSeparator

The string used to separate the mantissa from the exponent.

private char
groupingSeparator

Character used for grouping separator.

private transient volatile int
hashCode

Cached hash code.

private String
infinity

String used to represent infinity.

private String
intlCurrencySymbol

ISO 4217 currency code denoting the local currency, e.g. "USD".

private transient String
private Locale
locale

The locale of these currency format symbols.

private char
minusSign

Character used to represent minus sign.

private String
minusSignText

String representation of minus sign, which may include formatting characters, such as BiDi control characters.

private char
monetaryGroupingSeparator

The grouping separator used when formatting currency values.

private char
monetarySeparator

The decimal separator used when formatting currency values.

private String
NaN

String used to represent "not a number".

private char
patternSeparator

Character used to separate positive and negative subpatterns in a pattern.

private char
percent

Character used for percent sign.

private String
percentText

String representation of percent sign, which may include formatting characters, such as BiDi control characters.

private char
perMill

Character used for per mille sign.

private String
perMillText

String representation of per mille sign, which may include formatting characters, such as BiDi control characters.

private int
serialVersionOnStream

Describes the version of DecimalFormatSymbols present on the stream.

pack-priv static final long
private char
zeroDigit

Character used for zero.

Constructor Summary

AccessConstructor and Description
public
DecimalFormatSymbols()

Create a DecimalFormatSymbols object for the default FORMAT locale.

public
DecimalFormatSymbols(Locale
the desired locale
locale
)

Create a DecimalFormatSymbols object for the given locale.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Standard override.

public boolean

Returns:

true if the specified object is equal to this DecimalFormatSymbols
equals
(Object
object to be compared for equality
obj
)

Overrides java.lang.Object.equals.

Compares the specified object with this DecimalFormatSymbols for equality.

private char
findNonFormatChar(String src, char defChar)

Obtains non-format single character from String

public static Locale[]

Returns:

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

Returns an array of all locales for which the getInstance methods of this class can return localized instances.

public Currency

Returns:

the Currency of this DecimalFormatSymbols
getCurrency
()

Returns the Currency of this DecimalFormatSymbols.

public String

Returns:

the currency symbol
getCurrencySymbol
()

Returns the currency symbol for the currency of these DecimalFormatSymbols in their locale.

public char

Returns:

the character used for decimal sign
getDecimalSeparator
()

Gets the character used for decimal sign.

public char

Returns:

the character used for a digit in a pattern
getDigit
()

Gets the character used for a digit in a pattern.

pack-priv char
getExponentialSymbol()

Returns the character used to separate the mantissa from the exponent.

public String

Returns:

the exponent separator string
getExponentSeparator
()

Returns the string used to separate the mantissa from the exponent.

public char

Returns:

the grouping separator
getGroupingSeparator
()

Gets the character used for grouping separator.

public String

Returns:

the string representing infinity
getInfinity
()

Gets the string used to represent infinity.

public static final DecimalFormatSymbols

Returns:

a DecimalFormatSymbols instance.
getInstance
()

Gets the DecimalFormatSymbols instance for the default locale.

public static final DecimalFormatSymbols

Returns:

a DecimalFormatSymbols instance.
getInstance
(Locale
the desired locale.
locale
)

Gets the DecimalFormatSymbols instance for the specified locale.

public String

Returns:

the currency code
getInternationalCurrencySymbol
()

Returns the ISO 4217 currency code of the currency of these DecimalFormatSymbols.

pack-priv String

Returns:

the lenient minus signs
getLenientMinusSigns
()

Returns the lenient minus signs.

public Locale

Returns:

locale used to create this instance
getLocale
()

Returns locale used to create this instance.

public char

Returns:

the character representing minus sign
getMinusSign
()

Gets the character used to represent minus sign.

pack-priv String

Returns:

the string representing minus sign
getMinusSignText
()

Gets the string used to represent minus sign.

public char

Returns:

the monetary decimal separator
getMonetaryDecimalSeparator
()

Returns the monetary decimal separator.

public char

Returns:

the monetary grouping separator
getMonetaryGroupingSeparator
()

Gets the character used for grouping separator for currencies.

public String

Returns:

the string representing "not a number"
getNaN
()

Gets the string used to represent "not a number".

public char

Returns:

the pattern separator
getPatternSeparator
()

Gets the character used to separate positive and negative subpatterns in a pattern.

public char

Returns:

the character used for percent sign
getPercent
()

Gets the character used for percent sign.

pack-priv String

Returns:

the string used for percent sign
getPercentText
()

Gets the string used for percent sign.

public char

Returns:

the character used for per mille sign
getPerMill
()

Gets the character used for per mille sign.

pack-priv String

Returns:

the string used for per mille sign
getPerMillText
()

Gets the string used for per mille sign.

public char

Returns:

the character used for zero
getZeroDigit
()

Gets the character used for zero.

public int

Returns:

the hash code for this DecimalFormatSymbols
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code for this DecimalFormatSymbols.

private void
initialize(Locale locale)

Initializes the symbols from the FormatData resource bundle.

private void
initializeCurrency(Locale locale)

Lazy initialization for currency related fields

private Object[]
private void
readObject(ObjectInputStream stream)

Reads the default serializable fields, provides default values for objects in older serial versions, and initializes non-serializable fields.

public void
setCurrency(Currency
the new currency to be used
currency
)

Sets the currency of this DecimalFormatSymbols.

public void
setCurrencySymbol(String
the currency symbol
currency
)

Sets the currency symbol for the currency of this DecimalFormatSymbols in their locale.

public void
setDecimalSeparator(char
the character used for decimal sign
decimalSeparator
)

Sets the character used for decimal sign.

public void
setDigit(char
the character used for a digit in a pattern
digit
)

Sets the character used for a digit in a pattern.

pack-priv void
setExponentialSymbol(char exp)

Sets the character used to separate the mantissa from the exponent.

public void
setExponentSeparator(String
the exponent separator string
exp
)

Sets the string used to separate the mantissa from the exponent.

public void
setGroupingSeparator(char
the grouping separator
groupingSeparator
)

Sets the character used for grouping separator.

public void
setInfinity(String
the string representing infinity
infinity
)

Sets the string used to represent infinity.

public void
setInternationalCurrencySymbol(String
the currency code
currencyCode
)

Sets the ISO 4217 currency code of the currency of these DecimalFormatSymbols.

public void
setMinusSign(char
the character representing minus sign
minusSign
)

Sets the character used to represent minus sign.

pack-priv void
setMinusSignText(String
the character representing minus sign
minusSignText
)

Sets the string used to represent minus sign.

public void
setMonetaryDecimalSeparator(char
the monetary decimal separator
sep
)

Sets the monetary decimal separator.

public void
setMonetaryGroupingSeparator(char
the monetary grouping separator
monetaryGroupingSeparator
)

Sets the character used for grouping separator for currencies.

public void
setNaN(String
the string representing "not a number"
NaN
)

Sets the string used to represent "not a number".

public void
setPatternSeparator(char
the pattern separator
patternSeparator
)

Sets the character used to separate positive and negative subpatterns in a pattern.

public void
setPercent(char
the character used for percent sign
percent
)

Sets the character used for percent sign.

pack-priv void
setPercentText(String
the string used for percent sign
percentText
)

Sets the string used for percent sign.

public void
setPerMill(char
the character used for per mille sign
perMill
)

Sets the character used for per mille sign.

pack-priv void
setPerMillText(String
the string used for per mille sign
perMillText
)

Sets the string used for per mille sign.

public void
setZeroDigit(char
the character used for zero
zeroDigit
)

Sets the character used for zero.

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

currencyback to summary
private transient Currency currency
currencyInitializedback to summary
private transient volatile boolean currencyInitialized
currencySymbolback to summary
private String currencySymbol

String denoting the local currency, e.g. "$".

See Also
getCurrencySymbol
currentSerialVersionback to summary
private static final int currentSerialVersion
decimalSeparatorback to summary
private char decimalSeparator

Character used for decimal sign.

See Also
getDecimalSeparator
digitback to summary
private char digit

Character used for a digit in a pattern.

See Also
getDigit
exponentialback to summary
private char exponential

The character used to distinguish the exponent in a number formatted in exponential notation, e.g. 'E' for a number such as "1.23E45".

Note that the public API provides no way to set this field, even though it is supported by the implementation and the stream format. The intent is that this will be added to the API in the future.

Since
1.1.6
exponentialSeparatorback to summary
private String exponentialSeparator

The string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.

If both exponential and exponentialSeparator exist, this exponentialSeparator has the precedence.

Since
1.6
groupingSeparatorback to summary
private char groupingSeparator

Character used for grouping separator.

See Also
getGroupingSeparator
hashCodeback to summary
private transient volatile int hashCode

Cached hash code.

infinityback to summary
private String infinity

String used to represent infinity.

See Also
getInfinity
intlCurrencySymbolback to summary
private String intlCurrencySymbol

ISO 4217 currency code denoting the local currency, e.g. "USD".

See Also
getInternationalCurrencySymbol
lenientMinusSignsback to summary
private transient String lenientMinusSigns
localeback to summary
private Locale locale

The locale of these currency format symbols.

Since
1.4
minusSignback to summary
private char minusSign

Character used to represent minus sign.

See Also
getMinusSign
minusSignTextback to summary
private String minusSignText

String representation of minus sign, which may include formatting characters, such as BiDi control characters. The first non-format character of this string is the same as minusSign.

Since
13
monetaryGroupingSeparatorback to summary
private char monetaryGroupingSeparator

The grouping separator used when formatting currency values.

Since
15
monetarySeparatorback to summary
private char monetarySeparator

The decimal separator used when formatting currency values.

Since
1.1.6
See Also
getMonetaryDecimalSeparator
NaNback to summary
private String NaN

String used to represent "not a number".

See Also
getNaN
patternSeparatorback to summary
private char patternSeparator

Character used to separate positive and negative subpatterns in a pattern.

See Also
getPatternSeparator
percentback to summary
private char percent

Character used for percent sign.

See Also
getPercent
percentTextback to summary
private String percentText

String representation of percent sign, which may include formatting characters, such as BiDi control characters. The first non-format character of this string is the same as percent.

Since
13
perMillback to summary
private char perMill

Character used for per mille sign.

See Also
getPerMill
perMillTextback to summary
private String perMillText

String representation of per mille sign, which may include formatting characters, such as BiDi control characters. The first non-format character of this string is the same as perMill.

Since
13
serialVersionOnStreamback to summary
private int serialVersionOnStream

Describes the version of DecimalFormatSymbols present on the stream. Possible values are:

  • 0 (or uninitialized): versions prior to JDK 1.1.6.
  • 1: Versions written by JDK 1.1.6 or later, which include two new fields: monetarySeparator and exponential.
  • 2: Versions written by J2SE 1.4 or later, which include a new locale field.
  • 3: Versions written by J2SE 1.6 or later, which include a new exponentialSeparator field.
  • 4: Versions written by Java SE 13 or later, which include new perMillText, percentText, and minusSignText field.
  • 5: Versions written by Java SE 15 or later, which include new monetaryGroupingSeparator field. *
When streaming out a DecimalFormatSymbols, the most recent format (corresponding to the highest allowable serialVersionOnStream) is always written.
Since
1.1.6
serialVersionUIDback to summary
pack-priv static final long serialVersionUID
Annotations
@Serial
zeroDigitback to summary
private char zeroDigit

Character used for zero.

See Also
getZeroDigit

Constructor Detail

DecimalFormatSymbolsback to summary
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.

This is equivalent to calling DecimalFormatSymbols(Locale.getDefault(Locale.Category.FORMAT)).

See Also
java.util.Locale#getDefault(java.util.Locale.Category), java.util.Locale.Category#FORMAT
DecimalFormatSymbolsback to summary
public DecimalFormatSymbols(Locale locale)

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 java.util.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,

NumberFormat.getNumberInstance(Locale.forLanguageTag("th-TH-u-nu-thai"))
This may return a NumberFormat instance with the Thai numbering system, instead of the Latin numbering system.
Parameters
locale:Locale

the desired locale

Exceptions
NullPointerException:
if locale is null

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Standard override.

Annotations
@Override
equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Compares the specified object with this DecimalFormatSymbols for equality. Returns true if the object is also a DecimalFormatSymbols and the two DecimalFormatSymbols objects represent the same set of symbols.

Implementation Specification

This method performs an equality check with a notion of class identity based on getClass(), rather than instanceof. Therefore, in the equals methods in subclasses, no instance of this class should compare as equal to an instance of a subclass.

Parameters
obj:Object

object to be compared for equality

Returns:boolean

true if the specified object is equal to this DecimalFormatSymbols

Annotations
@Override
See Also
Object#equals(Object)
findNonFormatCharback to summary
private char findNonFormatChar(String src, char defChar)

Obtains non-format single character from String

getAvailableLocalesback to summary
public static Locale[] 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. At a minimum, the returned array must contain a Locale instance equal to Locale.ROOT and a Locale instance equal to Locale.US.

Returns:Locale[]

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

Since
1.6
getCurrencyback to summary
public Currency getCurrency()

Returns the Currency of this DecimalFormatSymbols.

Returns:Currency

the Currency of this DecimalFormatSymbols

Since
1.4
getCurrencySymbolback to summary
public String getCurrencySymbol()

Returns the currency symbol for the currency of these DecimalFormatSymbols in their locale.

Returns:String

the currency symbol

Since
1.2
getDecimalSeparatorback to summary
public char getDecimalSeparator()

Gets the character used for decimal sign. Different for French, etc.

Returns:char

the character used for decimal sign

getDigitback to summary
public char getDigit()

Gets the character used for a digit in a pattern.

Returns:char

the character used for a digit in a pattern

getExponentialSymbolback to summary
pack-priv char getExponentialSymbol()

Returns the character used to separate the mantissa from the exponent.

getExponentSeparatorback to summary
public String getExponentSeparator()

Returns the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.

Returns:String

the exponent separator string

Since
1.6
See Also
setExponentSeparator(java.lang.String)
getGroupingSeparatorback to summary
public char getGroupingSeparator()

Gets the character used for grouping separator. Different for French, etc.

Returns:char

the grouping separator

getInfinityback to summary
public String getInfinity()

Gets the string used to represent infinity. Almost always left unchanged.

Returns:String

the string representing infinity

getInstanceback to summary
public static final DecimalFormatSymbols 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.

This is equivalent to calling getInstance(Locale.getDefault(Locale.Category.FORMAT)).

Returns:DecimalFormatSymbols

a DecimalFormatSymbols instance.

Since
1.6
See Also
java.util.Locale#getDefault(java.util.Locale.Category), java.util.Locale.Category#FORMAT
getInstanceback to summary
public static final DecimalFormatSymbols getInstance(Locale locale)

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 java.util.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,

NumberFormat.getNumberInstance(Locale.forLanguageTag("th-TH-u-nu-thai"))
This may return a NumberFormat instance with the Thai numbering system, instead of the Latin numbering system.
Parameters
locale:Locale

the desired locale.

Returns:DecimalFormatSymbols

a DecimalFormatSymbols instance.

Exceptions
NullPointerException:
if locale is null
Since
1.6
getInternationalCurrencySymbolback to summary
public String getInternationalCurrencySymbol()

Returns the ISO 4217 currency code of the currency of these DecimalFormatSymbols.

Returns:String

the currency code

Since
1.2
getLenientMinusSignsback to summary
pack-priv String getLenientMinusSigns()

Returns the lenient minus signs. Multiple lenient minus signs are concatenated to form the returned string. Each codepoint in the string is a valid minus sign pattern. If there are no lenient minus signs defined in this locale, minusSignText is returned.

Returns:String

the lenient minus signs

getLocaleback to summary
public Locale getLocale()

Returns locale used to create this instance.

Returns:Locale

locale used to create this instance

Since
19
getMinusSignback to summary
public char getMinusSign()

Gets 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:char

the character representing minus sign

getMinusSignTextback to summary
pack-priv String getMinusSignText()

Gets the string used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSignText to the positive format.

Returns:String

the string representing minus sign

Since
13
getMonetaryDecimalSeparatorback to summary
public char getMonetaryDecimalSeparator()

Returns the monetary decimal separator.

Returns:char

the monetary decimal separator

Since
1.2
getMonetaryGroupingSeparatorback to summary
public char getMonetaryGroupingSeparator()

Gets the character used for grouping separator for currencies. May be different from grouping separator in some locales, e.g, German in Austria.

Returns:char

the monetary grouping separator

Since
15
getNaNback to summary
public String getNaN()

Gets the string used to represent "not a number". Almost always left unchanged.

Returns:String

the string representing "not a number"

getPatternSeparatorback to summary
public char getPatternSeparator()

Gets the character used to separate positive and negative subpatterns in a pattern.

Returns:char

the pattern separator

getPercentback to summary
public char getPercent()

Gets the character used for percent sign. Different for Arabic, etc.

Returns:char

the character used for percent sign

getPercentTextback to summary
pack-priv String getPercentText()

Gets the string used for percent sign. Different for Arabic, etc.

Returns:String

the string used for percent sign

Since
13
getPerMillback to summary
public char getPerMill()

Gets the character used for per mille sign. Different for Arabic, etc.

Returns:char

the character used for per mille sign

getPerMillTextback to summary
pack-priv String getPerMillText()

Gets the string used for per mille sign. Different for Arabic, etc.

Returns:String

the string used for per mille sign

Since
13
getZeroDigitback to summary
public char getZeroDigit()

Gets the character used for zero. Different for Arabic, etc.

Returns:char

the character used for zero

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code for this DecimalFormatSymbols.

Implementation Specification

Non-transient instance fields of this class are used to calculate a hash code value which adheres to the contract defined in Objects#hashCode.

Returns:int

the hash code for this DecimalFormatSymbols

Annotations
@Override
See Also
Object#hashCode()
initializeback to summary
private void initialize(Locale locale)

Initializes the symbols from the FormatData resource bundle.

initializeCurrencyback to summary
private void initializeCurrency(Locale locale)

Lazy initialization for currency related fields

loadNumberDataback to summary
private Object[] loadNumberData(Locale locale)
readObjectback to summary
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException

Reads the default serializable fields, provides default values for objects in older serial versions, and initializes non-serializable fields. If serialVersionOnStream is less than 1, initializes monetarySeparator to be the same as decimalSeparator and exponential to be 'E'. If serialVersionOnStream is less than 2, initializes locale to the root locale, and initializes If serialVersionOnStream is less than 3, it initializes exponentialSeparator using exponential. If serialVersionOnStream is less than 4, it initializes perMillText, percentText, and minusSignText using perMill, percent, and minusSign respectively. If serialVersionOnStream is less than 5, it initializes monetaryGroupingSeparator using groupingSeparator. Sets serialVersionOnStream back to the maximum allowed value so that default serialization will work properly if this object is streamed out again. Initializes the currency from the intlCurrencySymbol field.

Annotations
@Serial
Exceptions
InvalidObjectException:
if char and String representations of either percent, per mille, and/or minus sign disagree.
Since
1.1.6
setCurrencyback to summary
public void setCurrency(Currency currency)

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

Parameters
currency:Currency

the new currency to be used

Exceptions
NullPointerException:
if currency is null
Since
1.4
See Also
setCurrencySymbol, setInternationalCurrencySymbol
setCurrencySymbolback to summary
public void setCurrencySymbol(String currency)

Sets the currency symbol for the currency of this DecimalFormatSymbols in their locale. Unlike setInternationalCurrencySymbol(String), this method does not update the currency attribute nor the international currency symbol attribute.

Parameters
currency:String

the currency symbol

Exceptions
NullPointerException:
if currency is null
Since
1.2
setDecimalSeparatorback to summary
public void setDecimalSeparator(char decimalSeparator)

Sets the character used for decimal sign. Different for French, etc.

Parameters
decimalSeparator:char

the character used for decimal sign

setDigitback to summary
public void setDigit(char digit)

Sets the character used for a digit in a pattern.

Parameters
digit:char

the character used for a digit in a pattern

setExponentialSymbolback to summary
pack-priv void setExponentialSymbol(char exp)

Sets the character used to separate the mantissa from the exponent.

setExponentSeparatorback to summary
public void setExponentSeparator(String exp)

Sets the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.

Parameters
exp:String

the exponent separator string

Exceptions
NullPointerException:
if exp is null
Since
1.6
See Also
getExponentSeparator()
setGroupingSeparatorback to summary
public void setGroupingSeparator(char groupingSeparator)

Sets the character used for grouping separator. Different for French, etc.

Parameters
groupingSeparator:char

the grouping separator

setInfinityback to summary
public void setInfinity(String infinity)

Sets the string used to represent infinity. Almost always left unchanged.

Parameters
infinity:String

the string representing infinity

Exceptions
NullPointerException:
if infinity is null
setInternationalCurrencySymbolback to summary
public void setInternationalCurrencySymbol(String currencyCode)

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 and the currency symbol attribute are not modified.

Parameters
currencyCode:String

the currency code

Exceptions
NullPointerException:
if currencyCode is null
Since
1.2
See Also
setCurrency, setCurrencySymbol
setMinusSignback to summary
public void setMinusSign(char minusSign)

Sets 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:char

the character representing minus sign

setMinusSignTextback to summary
pack-priv void setMinusSignText(String minusSignText)

Sets the string used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSignText to the positive format. Setting the minusSignText affects the return value of getMinusSign(), in which the first non-format character of minusSignText is returned.

Parameters
minusSignText:String

the character representing minus sign

Exceptions
NullPointerException:
if minusSignText is null
IllegalArgumentException:
if minusSignText is an empty string
Since
13
See Also
getMinusSign(), getMinusSignText()
setMonetaryDecimalSeparatorback to summary
public void setMonetaryDecimalSeparator(char sep)

Sets the monetary decimal separator.

Parameters
sep:char

the monetary decimal separator

Since
1.2
setMonetaryGroupingSeparatorback to summary
public void setMonetaryGroupingSeparator(char monetaryGroupingSeparator)

Sets the character used for grouping separator for currencies. Invocation of this method will not affect the normal grouping separator.

Parameters
monetaryGroupingSeparator:char

the monetary grouping separator

Since
15
See Also
setGroupingSeparator(char)
setNaNback to summary
public void setNaN(String NaN)

Sets the string used to represent "not a number". Almost always left unchanged.

Parameters
NaN:String

the string representing "not a number"

Exceptions
NullPointerException:
if NaN is null
setPatternSeparatorback to summary
public void setPatternSeparator(char patternSeparator)

Sets the character used to separate positive and negative subpatterns in a pattern.

Parameters
patternSeparator:char

the pattern separator

setPercentback to summary
public void setPercent(char percent)

Sets the character used for percent sign. Different for Arabic, etc.

Parameters
percent:char

the character used for percent sign

setPercentTextback to summary
pack-priv void setPercentText(String percentText)

Sets the string used for percent sign. Different for Arabic, etc. Setting the percentText affects the return value of getPercent(), in which the first non-format character of percentText is returned.

Parameters
percentText:String

the string used for percent sign

Exceptions
NullPointerException:
if percentText is null
IllegalArgumentException:
if percentText is an empty string
Since
13
See Also
getPercent(), getPercentText()
setPerMillback to summary
public void setPerMill(char perMill)

Sets the character used for per mille sign. Different for Arabic, etc.

Parameters
perMill:char

the character used for per mille sign

setPerMillTextback to summary
pack-priv void setPerMillText(String perMillText)

Sets the string used for per mille sign. Different for Arabic, etc. Setting the perMillText affects the return value of getPerMill(), in which the first non-format character of perMillText is returned.

Parameters
perMillText:String

the string used for per mille sign

Exceptions
NullPointerException:
if perMillText is null
IllegalArgumentException:
if perMillText is an empty string
Since
13
See Also
getPerMill(), getPerMillText()
setZeroDigitback to summary
public void setZeroDigit(char zeroDigit)

Sets the character used for zero. Different for Arabic, etc.

Parameters
zeroDigit:char

the character used for zero