class U_I18N_API DecimalFormatSymbols

This class represents the set of symbols needed by DecimalFormat to format numbers

Public Methods

DecimalFormatSymbols(const Locale& locale, UErrorCode& status)
Create a DecimalFormatSymbols object for the given locale
DecimalFormatSymbols( UErrorCode& status)
Create a DecimalFormatSymbols object for the default locale
DecimalFormatSymbols(const DecimalFormatSymbols&)
Copy constructor
DecimalFormatSymbols& operator=(const DecimalFormatSymbols&)
Assignment operator
~DecimalFormatSymbols()
Destructor
bool_t operator==(const DecimalFormatSymbols& other) const
Return true if another object is semantically equal to this one
bool_t operator!=(const DecimalFormatSymbols& other) const
Return true if another object is semantically unequal to this one
UChar getZeroDigit(void) const
character used for zero
UChar getGroupingSeparator(void) const
character used for thousands separator
UChar getDecimalSeparator(void) const
character used for decimal sign
UChar getPerMill(void) const
character used for per mill sign
UChar getPercent(void) const
character used for percent sign
UChar getDigit(void) const
character used for a digit in a pattern
UChar getPatternSeparator(void) const
character used to separate positive and negative subpatterns in a pattern
UnicodeString& getInfinity(UnicodeString& result) const
character used to represent infinity
UnicodeString& getNaN(UnicodeString& result) const
character used to represent NaN
UChar getPlusSign(void) const
character used to represent plus sign
UChar getMinusSign(void) const
character used to represent minus sign
UChar getExponentialSymbol(void) const
character used to represent exponential
UnicodeString& getCurrencySymbol(UnicodeString& result) const
Return the string denoting the local currency
UnicodeString& getInternationalCurrencySymbol(UnicodeString& result) const
Return the international string denoting the local currency
UChar getMonetaryDecimalSeparator(void) const
Return the monetary decimal separator
UChar getPadEscape(void) const
Return the character used to pad numbers out to a specified width
void setPadEscape(UChar c)
Set the character used to pad numbers out to a specified width

Documentation

This class represents the set of symbols 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.

Here are the special characters used in the parts of the subpattern, with notes on their usage.

.       Symbol   Meaning
.         0      a digit
.         #      a digit, zero shows as absent
.         .      placeholder for decimal separator
.         ,      placeholder for grouping separator.
.         ;      separates formats.
.         -      default negative prefix.
.         %      divide by 100 and show as percentage
.         X      any other characters can be used in the prefix or suffix
.         '      used to quote special characters in a prefix or suffix.
[Notes]

If there is no explicit negative subpattern, - is prefixed to the positive form. That is, "0.00" alone is equivalent to "0.00;-0.00".

The grouping separator is commonly used for thousands, but in some countries for ten-thousands. The interval is a constant number of digits between the grouping characters, such as 100,000,000 or 1,0000,0000. If you supply a pattern with multiple grouping characters, the interval between the last one and the end of the integer is the one that is used. So "#,##,###,####" == "######,####" == "##,####,####".

This class only handles localized digits where the 10 digits are contiguous in Unicode, from 0 to 9. Other digits sets (such as superscripts) would need a different subclass.

DecimalFormatSymbols(const Locale& locale, UErrorCode& status)
Create a DecimalFormatSymbols object for the given locale.
Parameters:
locale - The locale to get symbols for.
status - Input/output parameter, set to success or failure code upon return.

DecimalFormatSymbols( UErrorCode& status)
Create a DecimalFormatSymbols object for the default locale. This constructor will not fail. If the resource file data is not available, it will use hard-coded last-resort data and set status to U_USING_FALLBACK_ERROR.
Parameters:
status - Input/output parameter, set to success or failure code upon return.

DecimalFormatSymbols(const DecimalFormatSymbols&)
Copy constructor

DecimalFormatSymbols& operator=(const DecimalFormatSymbols&)
Assignment operator

~DecimalFormatSymbols()
Destructor

bool_t operator==(const DecimalFormatSymbols& other) const
Return true if another object is semantically equal to this one

bool_t operator!=(const DecimalFormatSymbols& other) const
Return true if another object is semantically unequal to this one

UChar getZeroDigit(void) const
character used for zero. Different for Arabic, etc.

UChar getGroupingSeparator(void) const
character used for thousands separator. Different for French, etc.

UChar getDecimalSeparator(void) const
character used for decimal sign. Different for French, etc.

UChar getPerMill(void) const
character used for per mill sign. Different for Arabic, etc.

UChar getPercent(void) const
character used for percent sign. Different for Arabic, etc.

UChar getDigit(void) const
character used for a digit in a pattern

UChar getPatternSeparator(void) const
character used to separate positive and negative subpatterns in a pattern

UnicodeString& getInfinity(UnicodeString& result) const
character used to represent infinity. Almost always left unchanged.

UnicodeString& getNaN(UnicodeString& result) const
character used to represent NaN. Almost always left unchanged.

UChar getPlusSign(void) const
character used to represent plus sign

UChar getMinusSign(void) const
character used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSign to the positive format.

UChar getExponentialSymbol(void) const
character used to represent exponential. Almost always left unchanged.

UnicodeString& getCurrencySymbol(UnicodeString& result) const
Return the string denoting the local currency

UnicodeString& getInternationalCurrencySymbol(UnicodeString& result) const
Return the international string denoting the local currency

UChar getMonetaryDecimalSeparator(void) const
Return the monetary decimal separator

UChar getPadEscape(void) const
Return the character used to pad numbers out to a specified width. This is not the pad character itself; rather, it is the special pattern character preceding the pad character. In the pattern "*_#,##0", '*' is the pad escape, and '_' is the pad character.
Returns:
the character
See Also:
setPadEscape
getFormatWidth
getPadPosition
getPadCharacter

void setPadEscape(UChar c)
Set the character used to pad numbers out to a specified width. This is not the pad character itself; rather, it is the special pattern character preceding the pad character. In the pattern "*_#,##0", '*' is the pad escape, and '_' is the pad character.
See Also:
getPadEscape
setFormatWidth
setPadPosition
setPadCharacter


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de