Most visited

Recently visited

Added in API level 1

DecimalFormatSymbols

public class DecimalFormatSymbols
extends Object implements Cloneable, Serializable

java.lang.Object
    java.text.DecimalFormatSymbols


此类表示DecimalFormat格式化数字所需的一组符号(例如小数分隔符,分组分隔符等)。 DecimalFormat创建自身的实例DecimalFormatSymbols从它的语言环境数据。 如果您需要更改任何这些符号,您可以从DecimalFormat获取DecimalFormatSymbols对象并对其进行修改。

也可以看看:

摘要(Summary)

Public constructors

DecimalFormatSymbols()

为默认语言环境创建一个DecimalFormatSymbols对象。

DecimalFormatSymbols(Locale locale)

为给定的语言环境创建一个DecimalFormatSymbols对象。

公共方法(Public methods)

Object clone()

标准覆盖。

boolean equals(Object obj)

覆盖等于。

static Locale[] getAvailableLocales()

返回 getInstance方法可返回本地化实例的所有语言环境的数组。

Currency getCurrency()

获取这些DecimalFormatSymbols的货币。

String getCurrencySymbol()

返回其语言环境中这些DecimalFormatSymbols货币的货币符号。

char getDecimalSeparator()

获取用于十进制符号的字符。

char getDigit()

获取用于模式中数字的字符。

String getExponentSeparator()

返回用于将尾数与指数分开的字符串。

char getGroupingSeparator()

获取用于千位分隔符的字符。

String getInfinity()

获取用于表示无穷大的字符串。

static final DecimalFormatSymbols getInstance()

获取默认语言环境的 DecimalFormatSymbols实例。

static final DecimalFormatSymbols getInstance(Locale locale)

获取指定语言环境的 DecimalFormatSymbols实例。

String getInternationalCurrencySymbol()

返回这些DecimalFormatSymbols货币的ISO 4217货币代码。

char getMinusSign()

获取用于表示减号的字符。

char getMonetaryDecimalSeparator()

返回货币小数点分隔符。

String getNaN()

获取用于表示“不是数字”的字符串。

char getPatternSeparator()

获取用于在模式中分隔正面和负面子模式的字符。

char getPerMill()

获取用于每米勒符号的字符。

char getPercent()

获取用于百分号的字符。

char getZeroDigit()

获取用于零的字符。

int hashCode()

覆盖hashCode。

void setCurrency(Currency currency)

设置这些DecimalFormatSymbols的货币。

void setCurrencySymbol(String currency)

在这些DecimalFormatSymbols的语言环境中设置货币的货币符号。

void setDecimalSeparator(char decimalSeparator)

设置用于十进制符号的字符。

void setDigit(char digit)

设置模式中用于数字的字符。

void setExponentSeparator(String exp)

设置用于将尾数与指数分开的字符串。

void setGroupingSeparator(char groupingSeparator)

设置用于千位分隔符的字符。

void setInfinity(String infinity)

设置用于表示无穷大的字符串。

void setInternationalCurrencySymbol(String currencyCode)

设置这些DecimalFormatSymbols货币的ISO 4217货币代码。

void setMinusSign(char minusSign)

设置用于表示减号的字符。

void setMonetaryDecimalSeparator(char sep)

设置货币小数点分隔符。

void setNaN(String NaN)

设置用于表示“不是数字”的字符串。

void setPatternSeparator(char patternSeparator)

设置用于在模式中分隔正面和负面子模式的字符。

void setPerMill(char perMill)

设置每个米勒符号使用的字符。

void setPercent(char percent)

设置用于百分号的字符。

void setZeroDigit(char zeroDigit)

设置用于零的字符。

继承方法(Inherited methods)

From class java.lang.Object

Public constructors

DecimalFormatSymbols

Added in API level 1
DecimalFormatSymbols ()

为默认语言环境创建一个DecimalFormatSymbols对象。 此构造函数只能为Java运行时环境支持的语言环境构建实例,而不能为已安装的DecimalFormatSymbolsProvider实现支持的语言环境构建实例。 要获得完整的区域覆盖范围,请使用getInstance方法。

DecimalFormatSymbols

Added in API level 1
DecimalFormatSymbols (Locale locale)

为给定的语言环境创建一个DecimalFormatSymbols对象。 此构造函数只能为Java运行时环境支持的语言环境构建实例,而不能为已安装的DecimalFormatSymbolsProvider实现支持的语言环境构建实例。 要获得完整的区域覆盖,请使用getInstance方法。

参数(Parameters)
locale Locale
抛出异常(Throws)
NullPointerException if locale is null

公共方法(Public methods)

clone

Added in API level 1
Object clone ()

标准覆盖。

返回(Returns)
Object a clone of this instance.

equals

Added in API level 1
boolean equals (Object obj)

覆盖等于。

参数(Parameters)
obj Object: the reference object with which to compare.
返回(Returns)
boolean true if this object is the same as the obj argument; false otherwise.

getAvailableLocales

Added in API level 9
Locale[] getAvailableLocales ()

返回getInstance方法可返回本地化实例的所有语言环境的数组。 返回的数组表示Java运行时支持的语言环境联合以及安装的DecimalFormatSymbolsProvider实现。 它必须包含至少一个Locale情况下等于Locale.US

返回(Returns)
Locale[] An array of locales for which localized DecimalFormatSymbols instances are available.

getCurrency

Added in API level 1
Currency getCurrency ()

获取这些DecimalFormatSymbols的货币。 如果货币符号属性先前设置为不是有效的ISO 4217货币代码的值,则可能为空。

返回(Returns)
Currency the currency used, or null

getCurrencySymbol

Added in API level 1
String getCurrencySymbol ()

返回其语言环境中这些DecimalFormatSymbols货币的货币符号。

返回(Returns)
String

getDecimalSeparator

Added in API level 1
char getDecimalSeparator ()

获取用于十进制符号的字符。 法国等不同

返回(Returns)
char

getDigit

Added in API level 1
char getDigit ()

获取用于模式中数字的字符。

返回(Returns)
char

getExponentSeparator

Added in API level 9
String getExponentSeparator ()

返回用于将尾数与指数分开的字符串。 例如:1.23x104的“x10 ^”,1.23E4的“E”。

返回(Returns)
String the exponent separator string

也可以看看:

getGroupingSeparator

Added in API level 1
char getGroupingSeparator ()

获取用于千位分隔符的字符。 法国等不同

返回(Returns)
char

getInfinity

Added in API level 1
String getInfinity ()

获取用于表示无穷大的字符串。 几乎总是保持不变。

返回(Returns)
String

getInstance

Added in API level 9
DecimalFormatSymbols getInstance ()

获取默认语言环境的DecimalFormatSymbols实例。 此方法提供对Java运行时本身支持的语言环境以及已安装的DecimalFormatSymbolsProvider实现支持的语言环境的DecimalFormatSymbols实例的访问。

返回(Returns)
DecimalFormatSymbols a DecimalFormatSymbols instance.

getInstance

Added in API level 9
DecimalFormatSymbols getInstance (Locale locale)

获取指定语言环境的DecimalFormatSymbols实例。 此方法提供对Java运行时自身支持的语言环境以及已安装的DecimalFormatSymbolsProvider实现支持的语言环境的DecimalFormatSymbols实例的访问。

参数(Parameters)
locale Locale: the desired locale.
返回(Returns)
DecimalFormatSymbols a DecimalFormatSymbols instance.
抛出异常(Throws)
NullPointerException if locale is null

getInternationalCurrencySymbol

Added in API level 1
String getInternationalCurrencySymbol ()

返回这些DecimalFormatSymbols货币的ISO 4217货币代码。

返回(Returns)
String

getMinusSign

Added in API level 1
char getMinusSign ()

获取用于表示减号的字符。 如果没有指定明确的否定格式,则通过将minusSign前缀到正格式来形成一个格式。

返回(Returns)
char

getMonetaryDecimalSeparator

Added in API level 1
char getMonetaryDecimalSeparator ()

返回货币小数点分隔符。

返回(Returns)
char

getNaN

Added in API level 1
String getNaN ()

获取用于表示“不是数字”的字符串。 几乎总是保持不变。

返回(Returns)
String

getPatternSeparator

Added in API level 1
char getPatternSeparator ()

获取用于在模式中分隔正面和负面子模式的字符。

返回(Returns)
char

getPerMill

Added in API level 1
char getPerMill ()

获取用于每米勒符号的字符。 阿拉伯语等不同

返回(Returns)
char

getPercent

Added in API level 1
char getPercent ()

获取用于百分号的字符。 阿拉伯语等不同

返回(Returns)
char

getZeroDigit

Added in API level 1
char getZeroDigit ()

获取用于零的字符。 阿拉伯语等不同

返回(Returns)
char

hashCode

Added in API level 1
int hashCode ()

覆盖hashCode。

返回(Returns)
int a hash code value for this object.

setCurrency

Added in API level 1
void setCurrency (Currency currency)

设置这些DecimalFormatSymbols的货币。 这还将货币符号属性设置为DecimalFormatSymbols区域设置中的货币符号,将国际货币符号属性设置为货币的ISO 4217货币代码。

参数(Parameters)
currency Currency: the new currency to be used
抛出异常(Throws)
NullPointerException if currency is null

也可以看看:

setCurrencySymbol

Added in API level 1
void setCurrencySymbol (String currency)

在这些DecimalFormatSymbols的语言环境中设置货币的货币符号。

参数(Parameters)
currency String

setDecimalSeparator

Added in API level 1
void setDecimalSeparator (char decimalSeparator)

设置用于十进制符号的字符。 法国等不同

参数(Parameters)
decimalSeparator char

setDigit

Added in API level 1
void setDigit (char digit)

设置模式中用于数字的字符。

参数(Parameters)
digit char

setExponentSeparator

Added in API level 9
void setExponentSeparator (String exp)

设置用于将尾数与指数分开的字符串。 例如:1.23x104的“x10 ^”,1.23E4的“E”。

参数(Parameters)
exp String: the exponent separator string
抛出异常(Throws)
NullPointerException if exp is null

也可以看看:

setGroupingSeparator

Added in API level 1
void setGroupingSeparator (char groupingSeparator)

设置用于千位分隔符的字符。 法国等不同

参数(Parameters)
groupingSeparator char

setInfinity

Added in API level 1
void setInfinity (String infinity)

设置用于表示无穷大的字符串。 几乎总是保持不变。

参数(Parameters)
infinity String

setInternationalCurrencySymbol

Added in API level 1
void setInternationalCurrencySymbol (String currencyCode)

设置这些DecimalFormatSymbols货币的ISO 4217货币代码。 如果货币代码有效(由Currency.getInstance定义),则还会将货币属性设置为相应的货币实例,将货币符号属性设置为DecimalFormatSymbols区域设置中的货币符号。 如果货币代码无效,则货币属性设置为空,货币符号属性不会修改。

参数(Parameters)
currencyCode String

也可以看看:

setMinusSign

Added in API level 1
void setMinusSign (char minusSign)

设置用于表示减号的字符。 如果没有指定明确的否定格式,则通过将minusSign前缀到正格式来形成一个格式。

参数(Parameters)
minusSign char

setMonetaryDecimalSeparator

Added in API level 1
void setMonetaryDecimalSeparator (char sep)

设置货币小数点分隔符。

参数(Parameters)
sep char

setNaN

Added in API level 1
void setNaN (String NaN)

设置用于表示“不是数字”的字符串。 几乎总是保持不变。

参数(Parameters)
NaN String

setPatternSeparator

Added in API level 1
void setPatternSeparator (char patternSeparator)

设置用于在模式中分隔正面和负面子模式的字符。

参数(Parameters)
patternSeparator char

setPerMill

Added in API level 1
void setPerMill (char perMill)

设置每个米勒符号使用的字符。 阿拉伯语等不同

参数(Parameters)
perMill char

setPercent

Added in API level 1
void setPercent (char percent)

设置用于百分号的字符。 阿拉伯语等不同

参数(Parameters)
percent char

setZeroDigit

Added in API level 1
void setZeroDigit (char zeroDigit)

设置用于零的字符。 阿拉伯语等不同

参数(Parameters)
zeroDigit char

Hooray!