Class DecimalFormatSymbols
- java.lang.Object
-
- com.ibm.icu.text.DecimalFormatSymbols
-
- All Implemented Interfaces:
Serializable
,Cloneable
public class DecimalFormatSymbols extends Object implements Cloneable, Serializable
[icu enhancement] ICU's replacement forjava.text.DecimalFormatSymbols
. Methods, fields, and other functionality specific to ICU are labeled '[icu]'. This class represents the set of symbols (such as the decimal separator, the grouping separator, and so on) needed byDecimalFormat
to format numbers.DecimalFormat
creates for itself an instance ofDecimalFormatSymbols
from its locale data. If you need to change any of these symbols, you can get theDecimalFormatSymbols
object from yourDecimalFormat
and modify it.- Author:
- Mark Davis, Alan Liu
- See Also:
Locale
,DecimalFormat
, Serialized Form- Status:
- Stable ICU 2.0.
-
-
Field Summary
Fields Modifier and Type Field Description static int
CURRENCY_SPC_CURRENCY_MATCH
[icu] Indicates the currency match pattern used ingetPatternForCurrencySpacing(int, boolean)
.static int
CURRENCY_SPC_INSERT
[icu] Indicates the insertion value used ingetPatternForCurrencySpacing(int, boolean)
.static int
CURRENCY_SPC_SURROUNDING_MATCH
[icu] Indicates the surrounding match pattern used ingetPatternForCurrencySpacing(int, boolean)
.
-
Constructor Summary
Constructors Constructor Description DecimalFormatSymbols()
Creates a DecimalFormatSymbols object for the defaultFORMAT
locale.DecimalFormatSymbols(ULocale locale)
[icu] Creates a DecimalFormatSymbols object for the given locale.DecimalFormatSymbols(Locale locale)
Creates a DecimalFormatSymbols object for the given locale.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description DecimalFormatSymbols
clone()
boolean
equals(Object obj)
static DecimalFormatSymbols
forNumberingSystem(ULocale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols corresponding to the givenNumberingSystem
.static DecimalFormatSymbols
forNumberingSystem(Locale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols corresponding to the givenNumberingSystem
.String
getApproximatelySignString()
Deprecated.This API is for technology preview only.static Locale[]
getAvailableLocales()
Returns an array of all locales for which thegetInstance
methods of this class can return localized instances.static ULocale[]
getAvailableULocales()
[icu] Returns an array of all locales for which thegetInstance
methods of this class can return localized instances.int
getCodePointZero()
Deprecated.This API is ICU internal only.Currency
getCurrency()
Returns the currency symbol, forgetCurrency()
API compatibility only.String
getCurrencyPattern()
Deprecated.This API is for ICU internal use onlyString
getCurrencySymbol()
Returns the string denoting the local currency.char
getDecimalSeparator()
Returns the character used for decimal sign.String
getDecimalSeparatorString()
[icu] Returns the string used for decimal sign.char
getDigit()
Returns the character used for a digit in a pattern.char[]
getDigits()
Returns the array of characters used as digits, in order from 0 through 9String[]
getDigitStrings()
[icu] Returns the array of strings used as digits, in order from 0 through 9String[]
getDigitStringsLocal()
Deprecated.This API is ICU internal only.String
getExponentMultiplicationSign()
Returns the multiplication signString
getExponentSeparator()
[icu] Returns the string used to separate the mantissa from the exponent.char
getGroupingSeparator()
Returns the character used for grouping separator.String
getGroupingSeparatorString()
[icu] Returns the string used for grouping separator.String
getInfinity()
Returns the String used to represent infinity.static DecimalFormatSymbols
getInstance()
Returns a DecimalFormatSymbols instance for the default locale.static DecimalFormatSymbols
getInstance(ULocale locale)
Returns a DecimalFormatSymbols instance for the given locale.static DecimalFormatSymbols
getInstance(Locale locale)
Returns a DecimalFormatSymbols instance for the given locale.String
getInternationalCurrencySymbol()
Returns the international string denoting the local currency.Locale
getLocale()
Returns the locale for which this object was constructed.ULocale
getLocale(ULocale.Type type)
[icu] Returns the locale that was used to create this object, or null.char
getMinusSign()
Returns the character used to represent minus sign.String
getMinusSignString()
[icu] Returns the string used to represent minus sign.char
getMonetaryDecimalSeparator()
Returns the monetary decimal separator.String
getMonetaryDecimalSeparatorString()
[icu] Returns the monetary decimal separator string.char
getMonetaryGroupingSeparator()
[icu] Returns the monetary grouping separator.String
getMonetaryGroupingSeparatorString()
[icu] Returns the monetary grouping separator.String
getNaN()
Returns the String used to represent NaN.char
getPadEscape()
[icu] Returns the character used to pad numbers out to a specified width.String
getPatternForCurrencySpacing(int itemType, boolean beforeCurrency)
[icu] Returns the desired currency spacing value.char
getPatternSeparator()
Returns the character used to separate positive and negative subpatterns in a pattern.char
getPercent()
Returns the character used for percent sign.String
getPercentString()
[icu] Returns the string used for percent sign.char
getPerMill()
Returns the character used for mille percent sign.String
getPerMillString()
[icu] Returns the string used for permille sign.char
getPlusSign()
[icu] Returns the localized plus sign.String
getPlusSignString()
[icu] Returns the string used to represent plus sign.char
getSignificantDigit()
Returns the character used to represent a significant digit in a pattern.ULocale
getULocale()
Returns the locale for which this object was constructed.char
getZeroDigit()
Returns the character used for zero.int
hashCode()
void
setApproximatelySignString(String approximatelySignString)
Deprecated.This API is for technology preview only.void
setCurrency(Currency currency)
Sets the currency.void
setCurrencySymbol(String currency)
Sets the string denoting the local currency.void
setDecimalSeparator(char decimalSeparator)
Sets the character used for decimal sign.void
setDecimalSeparatorString(String decimalSeparatorString)
[icu] Sets the string used for decimal sign.void
setDigit(char digit)
Sets the character used for a digit in a pattern.void
setDigitStrings(String[] digitStrings)
[icu] Sets the array of strings used as digits, in order from 0 through 9void
setExponentMultiplicationSign(String exponentMultiplicationSign)
Sets the multiplication signvoid
setExponentSeparator(String exp)
[icu] Sets the string used to separate the mantissa from the exponent.void
setGroupingSeparator(char groupingSeparator)
Sets the character used for grouping separator.void
setGroupingSeparatorString(String groupingSeparatorString)
[icu] Sets the string used for grouping separator.void
setInfinity(String infinity)
Sets the String used to represent infinity.void
setInternationalCurrencySymbol(String currency)
Sets the international string denoting the local currency.void
setMinusSign(char minusSign)
Sets the character used to represent minus sign.void
setMinusSignString(String minusSignString)
[icu] Sets the string used to represent minus sign.void
setMonetaryDecimalSeparator(char sep)
Sets the monetary decimal separator.void
setMonetaryDecimalSeparatorString(String sep)
[icu] Sets the monetary decimal separator string.void
setMonetaryGroupingSeparator(char sep)
[icu] Sets the monetary grouping separator.void
setMonetaryGroupingSeparatorString(String sep)
[icu] Sets the monetary grouping separator string.void
setNaN(String NaN)
Sets the String used to represent NaN.void
setPadEscape(char c)
[icu] Sets the character used to pad numbers out to a specified width.void
setPatternForCurrencySpacing(int itemType, boolean beforeCurrency, String pattern)
[icu] Sets the indicated currency spacing pattern or value.void
setPatternSeparator(char patternSeparator)
Sets the character used to separate positive and negative subpatterns in a pattern.void
setPercent(char percent)
Sets the character used for percent sign.void
setPercentString(String percentString)
[icu] Sets the string used for percent sign.void
setPerMill(char perMill)
Sets the character used for mille percent sign.void
setPerMillString(String perMillString)
[icu] Sets the string used for permille sign.void
setPlusSign(char plus)
[icu] Sets the localized plus sign.void
setPlusSignString(String plusSignString)
[icu] Sets the localized plus sign string.void
setSignificantDigit(char sigDigit)
Sets the character used to represent a significant digit in a pattern.void
setZeroDigit(char zeroDigit)
Sets the character used for zero.
-
-
-
Field Detail
-
CURRENCY_SPC_CURRENCY_MATCH
public static final int CURRENCY_SPC_CURRENCY_MATCH
[icu] Indicates the currency match pattern used ingetPatternForCurrencySpacing(int, boolean)
.- See Also:
- Constant Field Values
- Status:
- Stable ICU 4.2.
-
CURRENCY_SPC_SURROUNDING_MATCH
public static final int CURRENCY_SPC_SURROUNDING_MATCH
[icu] Indicates the surrounding match pattern used ingetPatternForCurrencySpacing(int, boolean)
.- See Also:
- Constant Field Values
- Status:
- Stable ICU 4.2.
-
CURRENCY_SPC_INSERT
public static final int CURRENCY_SPC_INSERT
[icu] Indicates the insertion value used ingetPatternForCurrencySpacing(int, boolean)
.- See Also:
- Constant Field Values
- Status:
- Stable ICU 4.4.
-
-
Constructor Detail
-
DecimalFormatSymbols
public DecimalFormatSymbols()
Creates a DecimalFormatSymbols object for the defaultFORMAT
locale.- See Also:
ULocale.Category.FORMAT
- Status:
- Stable ICU 2.0.
-
DecimalFormatSymbols
public DecimalFormatSymbols(Locale locale)
Creates a DecimalFormatSymbols object for the given locale.- Parameters:
locale
- the locale- Status:
- Stable ICU 2.0.
-
DecimalFormatSymbols
public DecimalFormatSymbols(ULocale locale)
[icu] Creates a DecimalFormatSymbols object for the given locale.- Parameters:
locale
- the locale- Status:
- Stable ICU 3.2.
-
-
Method Detail
-
getInstance
public static DecimalFormatSymbols getInstance()
Returns a DecimalFormatSymbols instance for the default locale.Note: Unlike
java.text.DecimalFormatSymbols#getInstance
, this method simply returnsnew com.ibm.icu.text.DecimalFormatSymbols()
. ICU currently does not supportDecimalFormatSymbolsProvider
, which was introduced in Java 6.- Returns:
- A DecimalFormatSymbols instance.
- Status:
- Stable ICU 3.8.
-
getInstance
public static DecimalFormatSymbols getInstance(Locale locale)
Returns a DecimalFormatSymbols instance for the given locale.Note: Unlike
java.text.DecimalFormatSymbols#getInstance
, this method simply returnsnew com.ibm.icu.text.DecimalFormatSymbols(locale)
. ICU currently does not supportDecimalFormatSymbolsProvider
, which was introduced in Java 6.- Parameters:
locale
- the locale.- Returns:
- A DecimalFormatSymbols instance.
- Status:
- Stable ICU 3.8.
-
getInstance
public static DecimalFormatSymbols getInstance(ULocale locale)
Returns a DecimalFormatSymbols instance for the given locale.Note: Unlike
java.text.DecimalFormatSymbols#getInstance
, this method simply returnsnew com.ibm.icu.text.DecimalFormatSymbols(locale)
. ICU currently does not supportDecimalFormatSymbolsProvider
, which was introduced in Java 6.- Parameters:
locale
- the locale.- Returns:
- A DecimalFormatSymbols instance.
- Status:
- Stable ICU 3.8.
-
forNumberingSystem
public static DecimalFormatSymbols forNumberingSystem(Locale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols corresponding to the givenNumberingSystem
.This method behaves equivalently to
getInstance()
called with a locale having a "numbers=xxxx" keyword specifying the numbering system by name.In this method, the NumberingSystem argument will be used even if the locale has its own "numbers=xxxx" keyword.
- Parameters:
locale
- the locale.ns
- the numbering system.- Returns:
- A DecimalFormatSymbols instance.
- Status:
- Stable ICU 60.
-
forNumberingSystem
public static DecimalFormatSymbols forNumberingSystem(ULocale locale, NumberingSystem ns)
[icu] Returns a DecimalFormatSymbols instance for the given locale with digits and symbols corresponding to the givenNumberingSystem
.This method behaves equivalently to
getInstance()
called with a locale having a "numbers=xxxx" keyword specifying the numbering system by name.In this method, the NumberingSystem argument will be used even if the locale has its own "numbers=xxxx" keyword.
- Parameters:
locale
- the locale.ns
- the numbering system.- Returns:
- A DecimalFormatSymbols instance.
- Status:
- Stable ICU 60.
-
getAvailableLocales
public static Locale[] getAvailableLocales()
Returns an array of all locales for which thegetInstance
methods of this class can return localized instances.Note: Unlike
java.text.DecimalFormatSymbols#getAvailableLocales
, this method simply returns the array ofLocale
s available for this class. ICU currently does not supportDecimalFormatSymbolsProvider
, which was introduced in Java 6.- Returns:
- An array of
Locale
s for which localizedDecimalFormatSymbols
instances are available. - Status:
- Stable ICU 3.8.
-
getAvailableULocales
public static ULocale[] getAvailableULocales()
[icu] Returns an array of all locales for which thegetInstance
methods of this class can return localized instances.Note: Unlike
java.text.DecimalFormatSymbols#getAvailableLocales
, this method simply returns the array ofULocale
s available in this class. ICU currently does not supportDecimalFormatSymbolsProvider
, which was introduced in Java 6.- Returns:
- An array of
ULocale
s for which localizedDecimalFormatSymbols
instances are available. - Status:
- Stable ICU 3.8 (retain).
-
getZeroDigit
public char getZeroDigit()
Returns the character used for zero. Different for Arabic, etc.- Returns:
- the character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
getDigits
public char[] getDigits()
Returns the array of characters used as digits, in order from 0 through 9- Returns:
- The array
- See Also:
getDigitStrings()
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 4.6.
-
setZeroDigit
public void setZeroDigit(char zeroDigit)
Sets the character used for zero.Note: This method propagates digit 1 to digit 9 by incrementing code point one by one.
- Parameters:
zeroDigit
- the zero character.- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
getDigitStrings
public String[] getDigitStrings()
[icu] Returns the array of strings used as digits, in order from 0 through 9- Returns:
- The array of ten digit strings
- See Also:
setDigitStrings(String[])
- Status:
- Stable ICU 58.
-
getDigitStringsLocal
@Deprecated public String[] getDigitStringsLocal()
Deprecated.This API is ICU internal only.Returns the array of strings used as digits, in order from 0 through 9 Package private method - doesn't create a defensively copy.WARNING: Mutating the returned array will cause undefined behavior. If you need to change the value of the array, use
getDigitStrings()
andsetDigitStrings(java.lang.String[])
instead.- Returns:
- the array of digit strings
- Status:
- Internal. This API is ICU internal only.
-
getCodePointZero
@Deprecated public int getCodePointZero()
Deprecated.This API is ICU internal only.If the digit strings array corresponds to a sequence of increasing code points, this method returns the code point corresponding to the first entry in the digit strings array. If the digit strings array is not a sequence of increasing code points, returns -1.- Status:
- Internal. This API is ICU internal only.
-
setDigitStrings
public void setDigitStrings(String[] digitStrings)
[icu] Sets the array of strings used as digits, in order from 0 through 9Note:
When the input array of digit strings contains any strings represented by multiple Java chars, then
getDigits()
will return the default digits ('0' - '9') andgetZeroDigit()
will return the default zero digit ('0').- Parameters:
digitStrings
- The array of digit strings. The length of the array must be exactly 10.- Throws:
NullPointerException
- if thedigitStrings
is null.IllegalArgumentException
- if the length of the array is not 10.- See Also:
getDigitStrings()
- Status:
- Stable ICU 58.
-
getSignificantDigit
public char getSignificantDigit()
Returns the character used to represent a significant digit in a pattern.- Returns:
- the significant digit pattern character
- Status:
- Stable ICU 3.0.
-
setSignificantDigit
public void setSignificantDigit(char sigDigit)
Sets the character used to represent a significant digit in a pattern.- Parameters:
sigDigit
- the significant digit pattern character- Status:
- Stable ICU 3.0.
-
getGroupingSeparator
public char getGroupingSeparator()
Returns the character used for grouping separator. Different for French, etc.- Returns:
- the thousands character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
setGroupingSeparator
public void setGroupingSeparator(char groupingSeparator)
Sets the character used for grouping separator. Different for French, etc.- Parameters:
groupingSeparator
- the thousands character- See Also:
setGroupingSeparatorString(String)
- Status:
- Stable ICU 2.0.
-
getGroupingSeparatorString
public String getGroupingSeparatorString()
[icu] Returns the string used for grouping separator. Different for French, etc.- Returns:
- the grouping separator string
- See Also:
setGroupingSeparatorString(String)
- Status:
- Stable ICU 58.
-
setGroupingSeparatorString
public void setGroupingSeparatorString(String groupingSeparatorString)
[icu] Sets the string used for grouping separator.Note: When the input grouping separator String is represented by multiple Java chars, then
getGroupingSeparator()
will return the default grouping separator character (',').- Parameters:
groupingSeparatorString
- the grouping separator string- Throws:
NullPointerException
- ifgroupingSeparatorString
is null.- See Also:
getGroupingSeparatorString()
- Status:
- Stable ICU 58.
-
getDecimalSeparator
public char getDecimalSeparator()
Returns the character used for decimal sign. Different for French, etc.- Returns:
- the decimal character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
setDecimalSeparator
public void setDecimalSeparator(char decimalSeparator)
Sets the character used for decimal sign. Different for French, etc.- Parameters:
decimalSeparator
- the decimal character- Status:
- Stable ICU 2.0.
-
getDecimalSeparatorString
public String getDecimalSeparatorString()
[icu] Returns the string used for decimal sign.- Returns:
- the decimal sign string
- See Also:
setDecimalSeparatorString(String)
- Status:
- Stable ICU 58.
-
setDecimalSeparatorString
public void setDecimalSeparatorString(String decimalSeparatorString)
[icu] Sets the string used for decimal sign.Note: When the input decimal separator String is represented by multiple Java chars, then
getDecimalSeparator()
will return the default decimal separator character ('.').- Parameters:
decimalSeparatorString
- the decimal sign string- Throws:
NullPointerException
- ifdecimalSeparatorString
is null.- See Also:
getDecimalSeparatorString()
- Status:
- Stable ICU 58.
-
getPerMill
public char getPerMill()
Returns the character used for mille percent sign. Different for Arabic, etc.- Returns:
- the mille percent character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
setPerMill
public void setPerMill(char perMill)
Sets the character used for mille percent sign. Different for Arabic, etc.- Parameters:
perMill
- the mille percent character- Status:
- Stable ICU 2.0.
-
getPerMillString
public String getPerMillString()
[icu] Returns the string used for permille sign.- Returns:
- the permille string
- See Also:
setPerMillString(String)
- Status:
- Stable ICU 58.
-
setPerMillString
public void setPerMillString(String perMillString)
[icu] Sets the string used for permille sign.Note: When the input permille String is represented by multiple Java chars, then
getPerMill()
will return the default permille character ('‰').- Parameters:
perMillString
- the permille string- Throws:
NullPointerException
- ifperMillString
is null.- See Also:
getPerMillString()
- Status:
- Stable ICU 58.
-
getPercent
public char getPercent()
Returns the character used for percent sign. Different for Arabic, etc.- Returns:
- the percent character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
setPercent
public void setPercent(char percent)
Sets the character used for percent sign. Different for Arabic, etc.- Parameters:
percent
- the percent character- Status:
- Stable ICU 2.0.
-
getPercentString
public String getPercentString()
[icu] Returns the string used for percent sign.- Returns:
- the percent string
- See Also:
setPercentString(String)
- Status:
- Stable ICU 58.
-
setPercentString
public void setPercentString(String percentString)
[icu] Sets the string used for percent sign.Note: When the input grouping separator String is represented by multiple Java chars, then
getPercent()
will return the default percent sign character ('%').- Parameters:
percentString
- the percent string- Throws:
NullPointerException
- ifpercentString
is null.- See Also:
getPercentString()
- Status:
- Stable ICU 58.
-
getDigit
public char getDigit()
Returns the character used for a digit in a pattern.- Returns:
- the digit pattern character
- Status:
- Stable ICU 2.0.
-
setDigit
public void setDigit(char digit)
Sets the character used for a digit in a pattern.- Parameters:
digit
- the digit pattern character- Status:
- Stable ICU 2.0.
-
getPatternSeparator
public char getPatternSeparator()
Returns the character used to separate positive and negative subpatterns in a pattern.- Returns:
- the pattern separator character
- Status:
- Stable ICU 2.0.
-
setPatternSeparator
public void setPatternSeparator(char patternSeparator)
Sets the character used to separate positive and negative subpatterns in a pattern.- Parameters:
patternSeparator
- the pattern separator character- Status:
- Stable ICU 2.0.
-
getInfinity
public String getInfinity()
Returns the String used to represent infinity. Almost always left unchanged.- Returns:
- the Infinity string
- Status:
- Stable ICU 2.0.
-
setInfinity
public void setInfinity(String infinity)
Sets the String used to represent infinity. Almost always left unchanged.- Parameters:
infinity
- the Infinity String- Status:
- Stable ICU 2.0.
-
getNaN
public String getNaN()
Returns the String used to represent NaN. Almost always left unchanged.- Returns:
- the NaN String
- Status:
- Stable ICU 2.0.
-
setNaN
public void setNaN(String NaN)
Sets the String used to represent NaN. Almost always left unchanged.- Parameters:
NaN
- the NaN String- Status:
- Stable ICU 2.0.
-
getMinusSign
public char getMinusSign()
Returns the character used to represent minus sign. If no explicit negative format is specified, one is formed by prefixing minusSign to the positive format.- Returns:
- the minus sign character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
setMinusSign
public void setMinusSign(char minusSign)
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
- the minus sign character- Status:
- Stable ICU 2.0.
-
getMinusSignString
public String getMinusSignString()
[icu] Returns the string used to represent minus sign.- Returns:
- the minus sign string
- See Also:
setMinusSignString(String)
- Status:
- Stable ICU 58.
-
setMinusSignString
public void setMinusSignString(String minusSignString)
[icu] Sets the string used to represent minus sign.Note: When the input minus sign String is represented by multiple Java chars, then
getMinusSign()
will return the default minus sign character ('-').- Parameters:
minusSignString
- the minus sign string- Throws:
NullPointerException
- ifminusSignString
is null.- See Also:
getGroupingSeparatorString()
- Status:
- Stable ICU 58.
-
getPlusSign
public char getPlusSign()
[icu] Returns the localized plus sign.- Returns:
- the plus sign, used in localized patterns and formatted strings
- See Also:
setPlusSign(char)
,setMinusSign(char)
,getMinusSign()
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
setPlusSign
public void setPlusSign(char plus)
[icu] Sets the localized plus sign.- Parameters:
plus
- the plus sign, used in localized patterns and formatted strings- See Also:
getPlusSign()
,setMinusSign(char)
,getMinusSign()
- Status:
- Stable ICU 2.0.
-
getPlusSignString
public String getPlusSignString()
[icu] Returns the string used to represent plus sign.- Returns:
- the plus sign string
- Status:
- Stable ICU 58.
-
setPlusSignString
public void setPlusSignString(String plusSignString)
[icu] Sets the localized plus sign string.Note: When the input plus sign String is represented by multiple Java chars, then
getPlusSign()
will return the default plus sign character ('+').- Parameters:
plusSignString
- the plus sign string, used in localized patterns and formatted strings- Throws:
NullPointerException
- ifplusSignString
is null.- See Also:
getPlusSignString()
- Status:
- Stable ICU 58.
-
getApproximatelySignString
@Deprecated public String getApproximatelySignString()
Deprecated.This API is for technology preview only.- Status:
- Technology Preview. This API is still in the early stages of development. Use at your own risk.
-
setApproximatelySignString
@Deprecated public void setApproximatelySignString(String approximatelySignString)
Deprecated.This API is for technology preview only.- Status:
- Technology Preview. This API is still in the early stages of development. Use at your own risk.
-
getCurrencySymbol
public String getCurrencySymbol()
Returns the string denoting the local currency.- Returns:
- the local currency String.
- Status:
- Stable ICU 2.0.
-
setCurrencySymbol
public void setCurrencySymbol(String currency)
Sets the string denoting the local currency.- Parameters:
currency
- the local currency String.- Status:
- Stable ICU 2.0.
-
getInternationalCurrencySymbol
public String getInternationalCurrencySymbol()
Returns the international string denoting the local currency.- Returns:
- the international string denoting the local currency
- Status:
- Stable ICU 2.0.
-
setInternationalCurrencySymbol
public void setInternationalCurrencySymbol(String currency)
Sets the international string denoting the local currency.- Parameters:
currency
- the international string denoting the local currency.- Status:
- Stable ICU 2.0.
-
getCurrency
public Currency getCurrency()
Returns the currency symbol, forgetCurrency()
API compatibility only. ICU clients should use the Currency API directly.- Returns:
- the currency used, or null
- Status:
- Stable ICU 3.4.
-
setCurrency
public void setCurrency(Currency currency)
Sets the currency.Note: ICU does not use the DecimalFormatSymbols for the currency any more. This API is present for API compatibility only.
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
- the new currency to be used- Throws:
NullPointerException
- ifcurrency
is null- See Also:
setCurrencySymbol(java.lang.String)
,setInternationalCurrencySymbol(java.lang.String)
- Status:
- Stable ICU 3.4.
-
getMonetaryDecimalSeparator
public char getMonetaryDecimalSeparator()
Returns the monetary decimal separator.- Returns:
- the monetary decimal separator character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 2.0.
-
setMonetaryDecimalSeparator
public void setMonetaryDecimalSeparator(char sep)
Sets the monetary decimal separator.- Parameters:
sep
- the monetary decimal separator character- Status:
- Stable ICU 2.0.
-
getMonetaryDecimalSeparatorString
public String getMonetaryDecimalSeparatorString()
[icu] Returns the monetary decimal separator string.- Returns:
- the monetary decimal separator string
- See Also:
setMonetaryDecimalSeparatorString(String)
- Status:
- Stable ICU 58.
-
setMonetaryDecimalSeparatorString
public void setMonetaryDecimalSeparatorString(String sep)
[icu] Sets the monetary decimal separator string.Note: When the input monetary decimal separator String is represented by multiple Java chars, then
getMonetaryDecimalSeparatorString()
will return the default monetary decimal separator character ('.').- Parameters:
sep
- the monetary decimal separator string- Throws:
NullPointerException
- ifsep
is null.- See Also:
getMonetaryDecimalSeparatorString()
- Status:
- Stable ICU 58.
-
getMonetaryGroupingSeparator
public char getMonetaryGroupingSeparator()
[icu] Returns the monetary grouping separator.- Returns:
- the monetary grouping separator character
- Discouraged:
- ICU 58 use
- Status:
- Stable ICU 3.6.
-
setMonetaryGroupingSeparator
public void setMonetaryGroupingSeparator(char sep)
[icu] Sets the monetary grouping separator.- Parameters:
sep
- the monetary grouping separator character- Status:
- Stable ICU 3.6.
-
getMonetaryGroupingSeparatorString
public String getMonetaryGroupingSeparatorString()
[icu] Returns the monetary grouping separator.- Returns:
- the monetary grouping separator string
- See Also:
setMonetaryGroupingSeparatorString(String)
- Status:
- Stable ICU 58.
-
setMonetaryGroupingSeparatorString
public void setMonetaryGroupingSeparatorString(String sep)
[icu] Sets the monetary grouping separator string.Note: When the input grouping separator String is represented by multiple Java chars, then
getMonetaryGroupingSeparator()
will return the default monetary grouping separator character (',').- Parameters:
sep
- the monetary grouping separator string- Throws:
NullPointerException
- ifsep
is null.- See Also:
getMonetaryGroupingSeparatorString()
- Status:
- Stable ICU 58.
-
getCurrencyPattern
@Deprecated public String getCurrencyPattern()
Deprecated.This API is for ICU internal use onlyInternal API for NumberFormat- Returns:
- String currency pattern string
-
getExponentMultiplicationSign
public String getExponentMultiplicationSign()
Returns the multiplication sign- Status:
- Stable ICU 54.
-
setExponentMultiplicationSign
public void setExponentMultiplicationSign(String exponentMultiplicationSign)
Sets the multiplication sign- Status:
- Stable ICU 54.
-
getExponentSeparator
public String getExponentSeparator()
[icu] Returns the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.- Returns:
- the localized exponent symbol, used in localized patterns and formatted strings
- See Also:
setExponentSeparator(java.lang.String)
- Status:
- Stable ICU 2.0.
-
setExponentSeparator
public void setExponentSeparator(String exp)
[icu] Sets the string used to separate the mantissa from the exponent. Examples: "x10^" for 1.23x10^4, "E" for 1.23E4.- Parameters:
exp
- the localized exponent symbol, used in localized patterns and formatted strings- See Also:
getExponentSeparator()
- Status:
- Stable ICU 2.0.
-
getPadEscape
public char getPadEscape()
[icu] Returns 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(char)
,DecimalFormat.getFormatWidth()
,DecimalFormat.getPadPosition()
,DecimalFormat.getPadCharacter()
- Status:
- Stable ICU 2.0.
-
setPadEscape
public void setPadEscape(char c)
[icu] Sets 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()
,DecimalFormat.setFormatWidth(int)
,DecimalFormat.setPadPosition(int)
,DecimalFormat.setPadCharacter(char)
- Status:
- Stable ICU 2.0.
-
getPatternForCurrencySpacing
public String getPatternForCurrencySpacing(int itemType, boolean beforeCurrency)
[icu] Returns the desired currency spacing value. Original values come from ICU's CLDR data based on the locale provided during construction, and can be null. These values govern what and when text is inserted between a currency code/name/symbol and the currency amount when formatting money.For more information, see UTS#35 section 5.10.2.
- Parameters:
itemType
- one of CURRENCY_SPC_CURRENCY_MATCH, CURRENCY_SPC_SURROUNDING_MATCH or CURRENCY_SPC_INSERTbeforeCurrency
- true to get thebeforeCurrency
values, false to get theafterCurrency
values.- Returns:
- the value, or null.
- See Also:
setPatternForCurrencySpacing(int, boolean, String)
- Status:
- Stable ICU 4.2.
-
setPatternForCurrencySpacing
public void setPatternForCurrencySpacing(int itemType, boolean beforeCurrency, String pattern)
[icu] Sets the indicated currency spacing pattern or value. SeegetPatternForCurrencySpacing(int, boolean)
for more information.Values for currency match and surrounding match must be
UnicodeSet
patterns. Values for insert can be any string.Note: ICU4J does not currently use this information.
- Parameters:
itemType
- one of CURRENCY_SPC_CURRENCY_MATCH, CURRENCY_SPC_SURROUNDING_MATCH or CURRENCY_SPC_INSERTbeforeCurrency
- true if the pattern is for before the currency symbol. false if the pattern is for after it.pattern
- string to override current setting; can be null.- See Also:
getPatternForCurrencySpacing(int, boolean)
- Status:
- Stable ICU 4.2.
-
getLocale
public Locale getLocale()
Returns the locale for which this object was constructed.- Returns:
- the locale for which this object was constructed
- Status:
- Stable ICU 2.0.
-
getULocale
public ULocale getULocale()
Returns the locale for which this object was constructed.- Returns:
- the locale for which this object was constructed
- Status:
- Stable ICU 3.2.
-
clone
public DecimalFormatSymbols clone()
-
getLocale
public final ULocale getLocale(ULocale.Type type)
[icu] Returns the locale that was used to create this object, or null. This may may differ from the locale requested at the time of this object's creation. For example, if an object is created for localeen_US_CALIFORNIA
, the actual data may be drawn fromen
(the actual locale), anden_US
may be the most specific locale that exists (the valid locale).Note: The actual locale is returned correctly, but the valid locale is not, in most cases.
- Parameters:
type
- type of information requested, eitherULocale.VALID_LOCALE
orULocale.ACTUAL_LOCALE
.- Returns:
- the information specified by type, or null if this object was not constructed from locale data.
- See Also:
ULocale
,ULocale.VALID_LOCALE
,ULocale.ACTUAL_LOCALE
- Status:
- Draft ICU 2.8 (retain).
-
-