Added in API level 26

DecimalStyle

class DecimalStyle
kotlin.Any
   ↳ java.time.format.DecimalStyle

Localized decimal style used in date and time formatting.

A significant part of dealing with dates and times is the localization. This class acts as a central point for accessing the information.

Summary

Public methods
Boolean
equals(other: Any?)

Checks if this DecimalStyle is equal to another DecimalStyle.

static MutableSet<Locale!>!

Lists all the locales that are supported.

Char

Gets the character that represents the decimal point.

Char

Gets the character that represents the negative sign.

Char

Gets the character that represents the positive sign.

Char

Gets the character that represents zero.

Int

A hash code for this DecimalStyle.

static DecimalStyle!
of(locale: Locale!)

Obtains the DecimalStyle for the specified locale.

static DecimalStyle!

Obtains the DecimalStyle for the default FORMAT locale.

String

Returns a string describing this DecimalStyle.

DecimalStyle!
withDecimalSeparator(decimalSeparator: Char)

Returns a copy of the info with a new character that represents the decimal point.

DecimalStyle!
withNegativeSign(negativeSign: Char)

Returns a copy of the info with a new character that represents the negative sign.

DecimalStyle!
withPositiveSign(positiveSign: Char)

Returns a copy of the info with a new character that represents the positive sign.

DecimalStyle!
withZeroDigit(zeroDigit: Char)

Returns a copy of the info with a new character that represents zero.

Properties
static DecimalStyle!

The standard set of non-localized decimal style symbols.

Public methods

equals

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

Checks if this DecimalStyle is equal to another DecimalStyle.

Parameters
obj the object to check, null returns false
Return
Boolean true if this is equal to the other date

getAvailableLocales

Added in API level 26
static fun getAvailableLocales(): MutableSet<Locale!>!

Lists all the locales that are supported.

The locale 'en_US' will always be present.

Return
MutableSet<Locale!>! a Set of Locales for which localization is supported

getDecimalSeparator

Added in API level 26
fun getDecimalSeparator(): Char

Gets the character that represents the decimal point.

The character used to represent a decimal point may vary by culture. This method specifies the character to use.

Return
Char the character for the decimal point

getNegativeSign

Added in API level 26
fun getNegativeSign(): Char

Gets the character that represents the negative sign.

The character used to represent a negative number may vary by culture. This method specifies the character to use.

Return
Char the character for the negative sign

getPositiveSign

Added in API level 26
fun getPositiveSign(): Char

Gets the character that represents the positive sign.

The character used to represent a positive number may vary by culture. This method specifies the character to use.

Return
Char the character for the positive sign

getZeroDigit

Added in API level 26
fun getZeroDigit(): Char

Gets the character that represents zero.

The character used to represent digits may vary by culture. This method specifies the zero character to use, which implies the characters for one to nine.

Return
Char the character for zero

hashCode

Added in API level 26
fun hashCode(): Int

A hash code for this DecimalStyle.

Return
Int a suitable hash code

of

Added in API level 26
static fun of(locale: Locale!): DecimalStyle!

Obtains the DecimalStyle for the specified locale.

This method provides access to locale sensitive decimal style symbols. If the locale contains "nu" (Numbering System) Unicode extensions, returned instance will reflect the values specified with those extensions.

Parameters
locale Locale!: the locale, not null
Return
DecimalStyle! the decimal style, not null

ofDefaultLocale

Added in API level 26
static fun ofDefaultLocale(): DecimalStyle!

Obtains the DecimalStyle for the default FORMAT locale.

This method provides access to locale sensitive decimal style symbols.

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

Return
DecimalStyle! the decimal style, not null

toString

Added in API level 26
fun toString(): String

Returns a string describing this DecimalStyle.

Return
String a string description, not null

withDecimalSeparator

Added in API level 26
fun withDecimalSeparator(decimalSeparator: Char): DecimalStyle!

Returns a copy of the info with a new character that represents the decimal point.

The character used to represent a decimal point may vary by culture. This method specifies the character to use.

Parameters
decimalSeparator Char: the character for the decimal point
Return
DecimalStyle! a copy with a new character that represents the decimal point, not null

withNegativeSign

Added in API level 26
fun withNegativeSign(negativeSign: Char): DecimalStyle!

Returns a copy of the info with a new character that represents the negative sign.

The character used to represent a negative number may vary by culture. This method specifies the character to use.

Parameters
negativeSign Char: the character for the negative sign
Return
DecimalStyle! a copy with a new character that represents the negative sign, not null

withPositiveSign

Added in API level 26
fun withPositiveSign(positiveSign: Char): DecimalStyle!

Returns a copy of the info with a new character that represents the positive sign.

The character used to represent a positive number may vary by culture. This method specifies the character to use.

Parameters
positiveSign Char: the character for the positive sign
Return
DecimalStyle! a copy with a new character that represents the positive sign, not null

withZeroDigit

Added in API level 26
fun withZeroDigit(zeroDigit: Char): DecimalStyle!

Returns a copy of the info with a new character that represents zero.

The character used to represent digits may vary by culture. This method specifies the zero character to use, which implies the characters for one to nine.

Parameters
zeroDigit Char: the character for zero
Return
DecimalStyle! a copy with a new character that represents zero, not null

Properties

STANDARD

Added in API level 26
static val STANDARD: DecimalStyle!

The standard set of non-localized decimal style symbols.

This uses standard ASCII characters for zero, positive, negative and a dot for the decimal point.