Added in API level 1

DecimalFormatSymbols

open class DecimalFormatSymbols : Cloneable, Serializable
kotlin.Any
   ↳ java.text.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.

Summary

Public constructors

Create a DecimalFormatSymbols object for the default FORMAT locale.

Create a DecimalFormatSymbols object for the given locale.

Public methods
open Any

Standard override.

open Boolean
equals(other: Any?)

Override equals.

open static Array<Locale!>!

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

open Currency!

Gets the currency of these DecimalFormatSymbols.

open String!

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

open Char

Gets the character used for decimal sign.

open Char

Gets the character used for a digit in a pattern.

open String!

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

open Char

Gets the character used for grouping separator.

open String!

Gets the string used to represent infinity.

static DecimalFormatSymbols!

Gets the DecimalFormatSymbols instance for the default locale.

static DecimalFormatSymbols!
getInstance(locale: Locale!)

Gets the DecimalFormatSymbols instance for the specified locale.

open String!

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

open Char

Gets the character used to represent minus sign.

open Char

Returns the monetary decimal separator.

open Char

Gets the character used for grouping separator for currencies.

open String!

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

open Char

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

open Char

Gets the character used for per mille sign.

open Char

Gets the character used for percent sign.

open Char

Gets the character used for zero.

open Int

Override hashCode.

open Unit
setCurrency(currency: Currency!)

Sets the currency of these DecimalFormatSymbols.

open Unit

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

open Unit
setDecimalSeparator(decimalSeparator: Char)

Sets the character used for decimal sign.

open Unit
setDigit(digit: Char)

Sets the character used for a digit in a pattern.

open Unit

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

open Unit
setGroupingSeparator(groupingSeparator: Char)

Sets the character used for grouping separator.

open Unit
setInfinity(infinity: String!)

Sets the string used to represent infinity.

open Unit

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

open Unit
setMinusSign(minusSign: Char)

Sets the character used to represent minus sign.

open Unit

Sets the monetary decimal separator.

open Unit
setMonetaryGroupingSeparator(monetaryGroupingSeparator: Char)

Sets the character used for grouping separator for currencies.

open Unit
setNaN(NaN: String!)

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

open Unit
setPatternSeparator(patternSeparator: Char)

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

open Unit
setPerMill(perMill: Char)

Sets the character used for per mille sign.

open Unit
setPercent(percent: Char)

Sets the character used for percent sign.

open Unit
setZeroDigit(zeroDigit: Char)

Sets the character used for zero.

Public constructors

DecimalFormatSymbols

Added in API level 1
DecimalFormatSymbols()

Create a DecimalFormatSymbols object for the default FORMAT locale. It is recommended that the getInstance method is used instead.

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

DecimalFormatSymbols

Added in API level 1
DecimalFormatSymbols(locale: Locale!)

Create a DecimalFormatSymbols object for the given locale. It is recommended that the getInstance method is used instead. 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
java.lang.NullPointerException if locale is null

Public methods

clone

Added in API level 1
open fun clone(): Any

Standard override.

Return
Any a clone of this instance.
Exceptions
java.lang.CloneNotSupportedException if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

equals

Added in API level 1
open fun equals(other: Any?): Boolean

Override equals.

Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getAvailableLocales

Added in API level 9
open static fun getAvailableLocales(): Array<Locale!>!

Returns an array of all locales for which the getInstance methods of this class can return localized instances. It must contain at least a Locale instance equal to Locale.US.

Return
Array<Locale!>! an array of locales for which localized DecimalFormatSymbols instances are available.

getCurrency

Added in API level 1
open fun getCurrency(): Currency!

Gets the currency of these DecimalFormatSymbols. May be null if the currency symbol attribute was previously set to a value that's not a valid ISO 4217 currency code.

Return
Currency! the currency used, or null

getCurrencySymbol

Added in API level 1
open fun getCurrencySymbol(): String!

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

Return
String! the currency symbol

getDecimalSeparator

Added in API level 1
open fun getDecimalSeparator(): Char

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

Return
Char the character used for decimal sign

getDigit

Added in API level 1
open fun getDigit(): Char

Gets the character used for a digit in a pattern.

Return
Char the character used for a digit in a pattern

getExponentSeparator

Added in API level 9
open fun getExponentSeparator(): String!

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

Return
String! the exponent separator string

getGroupingSeparator

Added in API level 1
open fun getGroupingSeparator(): Char

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

Return
Char the grouping separator

getInfinity

Added in API level 1
open fun getInfinity(): String!

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

Return
String! the string representing infinity

getInstance

Added in API level 9
static fun getInstance(): DecimalFormatSymbols!

Gets the DecimalFormatSymbols instance for the default locale.

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

Return
DecimalFormatSymbols! a DecimalFormatSymbols instance.

getInstance

Added in API level 9
static fun getInstance(locale: Locale!): DecimalFormatSymbols!

Gets the DecimalFormatSymbols instance for the specified locale. 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.
Return
DecimalFormatSymbols! a DecimalFormatSymbols instance.
Exceptions
java.lang.NullPointerException if locale is null

getInternationalCurrencySymbol

Added in API level 1
open fun getInternationalCurrencySymbol(): String!

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

Return
String! the currency code

getMinusSign

Added in API level 1
open fun getMinusSign(): Char

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.

Return
Char the character representing minus sign

getMonetaryDecimalSeparator

Added in API level 1
open fun getMonetaryDecimalSeparator(): Char

Returns the monetary decimal separator.

Return
Char the monetary decimal separator

getMonetaryGroupingSeparator

Added in API level 34
open fun getMonetaryGroupingSeparator(): Char

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

Return
Char the monetary grouping separator

getNaN

Added in API level 1
open fun getNaN(): String!

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

Return
String! the string representing "not a number"

getPatternSeparator

Added in API level 1
open fun getPatternSeparator(): Char

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

Return
Char the pattern separator

getPerMill

Added in API level 1
open fun getPerMill(): Char

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

Return
Char the character used for per mille sign

getPercent

Added in API level 1
open fun getPercent(): Char

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

Return
Char the character used for percent sign

getZeroDigit

Added in API level 1
open fun getZeroDigit(): Char

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

Return
Char the character used for zero

hashCode

Added in API level 1
open fun hashCode(): Int

Override hashCode.

Return
Int a hash code value for this object.

setCurrency

Added in API level 1
open fun setCurrency(currency: Currency!): Unit

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.

Parameters
currency Currency!: the new currency to be used
Exceptions
java.lang.NullPointerException if currency is null

setCurrencySymbol

Added in API level 1
open fun setCurrencySymbol(currency: String!): Unit

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

Parameters
currency String!: the currency symbol

setDecimalSeparator

Added in API level 1
open fun setDecimalSeparator(decimalSeparator: Char): Unit

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

Parameters
decimalSeparator Char: the character used for decimal sign

setDigit

Added in API level 1
open fun setDigit(digit: Char): Unit

Sets the character used for a digit in a pattern.

Parameters
digit Char: the character used for a digit in a pattern

setExponentSeparator

Added in API level 9
open fun setExponentSeparator(exp: String!): Unit

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
java.lang.NullPointerException if exp is null

setGroupingSeparator

Added in API level 1
open fun setGroupingSeparator(groupingSeparator: Char): Unit

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

Parameters
groupingSeparator Char: the grouping separator

setInfinity

Added in API level 1
open fun setInfinity(infinity: String!): Unit

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

Parameters
infinity String!: the string representing infinity

setInternationalCurrencySymbol

Added in API level 1
open fun setInternationalCurrencySymbol(currencyCode: String!): Unit

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.

Parameters
currencyCode String!: the currency code

setMinusSign

Added in API level 1
open fun setMinusSign(minusSign: Char): Unit

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

setMonetaryDecimalSeparator

Added in API level 1
open fun setMonetaryDecimalSeparator(sep: Char): Unit

Sets the monetary decimal separator.

Parameters
sep Char: the monetary decimal separator

setMonetaryGroupingSeparator

Added in API level 34
open fun setMonetaryGroupingSeparator(monetaryGroupingSeparator: Char): Unit

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

setNaN

Added in API level 1
open fun setNaN(NaN: String!): Unit

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

Parameters
NaN String!: the string representing "not a number"

setPatternSeparator

Added in API level 1
open fun setPatternSeparator(patternSeparator: Char): Unit

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

Parameters
patternSeparator Char: the pattern separator

setPerMill

Added in API level 1
open fun setPerMill(perMill: Char): Unit

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

Parameters
perMill Char: the character used for per mille sign

setPercent

Added in API level 1
open fun setPercent(percent: Char): Unit

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

Parameters
percent Char: the character used for percent sign

setZeroDigit

Added in API level 1
open fun setZeroDigit(zeroDigit: Char): Unit

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

Parameters
zeroDigit Char: the character used for zero