DecimalStyle

Localized decimal style used _in date and time formatting. !(p) A significant part of dealing with dates and times is the localization. This class acts as a central point for accessing the information.

@implSpec This class is immutable and thread-safe.

@since 1.8

Constructors

this
this(char zeroChar, char positiveSignChar, char negativeSignChar, char decimalPointChar)

Restricted constructor.

Members

Functions

convertNumberToI18N
string convertNumberToI18N(string numericText)

Converts the input numeric text to the internationalized form using the zero character.

convertToDigit
int convertToDigit(char ch)

Checks whether the character is a digit, based on the currently set zero character.

getDecimalSeparator
char getDecimalSeparator()

Gets the character that represents the decimal point. !(p) The character used to represent a decimal point may vary by culture. This method specifies the character to use.

getNegativeSign
char getNegativeSign()

Gets the character that represents the negative sign. !(p) The character used to represent a negative number may vary by culture. This method specifies the character to use.

getPositiveSign
char getPositiveSign()

Gets the character that represents the positive sign. !(p) The character used to represent a positive number may vary by culture. This method specifies the character to use.

getZeroDigit
char getZeroDigit()

Gets the character that represents zero. !(p) 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.

opEquals
bool opEquals(Object obj)

Checks if this DecimalStyle is equal to another DecimalStyle.

toHash
size_t toHash()

A hash code for this DecimalStyle.

toString
string toString()

Returns a string describing this DecimalStyle.

withDecimalSeparator
DecimalStyle withDecimalSeparator(char decimalSeparator)

Returns a copy of the info with a new character that represents the decimal point. !(p) The character used to represent a decimal point may vary by culture. This method specifies the character to use.

withNegativeSign
DecimalStyle withNegativeSign(char negativeSign)

Returns a copy of the info with a new character that represents the negative sign. !(p) The character used to represent a negative number may vary by culture. This method specifies the character to use.

withPositiveSign
DecimalStyle withPositiveSign(char positiveSign)

Returns a copy of the info with a new character that represents the positive sign. !(p) The character used to represent a positive number may vary by culture. This method specifies the character to use.

withZeroDigit
DecimalStyle withZeroDigit(char zeroDigit)

Returns a copy of the info with a new character that represents zero. !(p) 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.

Static functions

of
DecimalStyle of(Locale locale)

Obtains the DecimalStyle for the specified locale. !(p) This method provides access to locale sensitive decimal style symbols. If the locale contains "nu" (Numbering System) and/or "rg" (Region Override) <a href="../../util/Locale.html#def_locale_extension"> Unicode extensions</a>, returned instance will reflect the values specified with those extensions. If both "nu" and "rg" are specified, the value from the "nu" extension supersedes the implicit one from the "rg" extension.

Meta