类 NumberStyleFormatter
java.lang.Object
cn.taketoday.format.number.AbstractNumberFormatter
cn.taketoday.format.number.NumberStyleFormatter
A general-purpose number formatter using NumberFormat's number style.
Delegates to NumberFormat.getInstance(Locale).
Configures BigDecimal parsing so there is no loss in precision.
Allows configuration over the decimal number pattern.
The AbstractNumberFormatter.parse(String, Locale) routine always returns a BigDecimal.
- 从以下版本开始:
- 4.0
- 作者:
- Keith Donald, Juergen Hoeller
- 另请参阅:
-
构造器概要
构造器构造器说明Create a new NumberStyleFormatter without a pattern.NumberStyleFormatter(String pattern) Create a new NumberStyleFormatter with the specified pattern. -
方法概要
修饰符和类型方法说明getNumberFormat(Locale locale) Obtain a concrete NumberFormat for the specified locale.voidsetPattern(String pattern) Specify the pattern to use to format number values.从类继承的方法 cn.taketoday.format.number.AbstractNumberFormatter
parse, print, setLenient
-
构造器详细资料
-
NumberStyleFormatter
public NumberStyleFormatter()Create a new NumberStyleFormatter without a pattern. -
NumberStyleFormatter
Create a new NumberStyleFormatter with the specified pattern.- 参数:
pattern- the format pattern- 另请参阅:
-
-
方法详细资料
-
setPattern
Specify the pattern to use to format number values. If not specified, the default DecimalFormat pattern is used. -
getNumberFormat
从类复制的说明:AbstractNumberFormatterObtain a concrete NumberFormat for the specified locale.- 指定者:
getNumberFormat在类中AbstractNumberFormatter- 参数:
locale- the current locale- 返回:
- the NumberFormat instance (never
null)
-