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 |
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 |
hashCode() A hash code for this DecimalStyle. |
static DecimalStyle! |
Obtains the DecimalStyle for the specified locale. |
static DecimalStyle! |
Obtains the DecimalStyle for the default |
String |
toString() 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
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
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
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
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
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
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
fun hashCode(): Int
A hash code for this DecimalStyle.
Return | |
---|---|
Int |
a suitable hash code |
of
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
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 |
See Also
toString
fun toString(): String
Returns a string describing this DecimalStyle.
Return | |
---|---|
String |
a string description, not null |
withDecimalSeparator
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
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
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
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
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.