|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.format.number.AbstractNumberFormatter org.springframework.format.number.NumberFormatter
public class NumberFormatter
A general-purpose Number formatter.
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.
setPattern(java.lang.String)
,
AbstractNumberFormatter.setLenient(boolean)
Constructor Summary | |
---|---|
NumberFormatter()
Create a new NumberFormatter without a pattern. |
|
NumberFormatter(String pattern)
Create a new NumberFormatter with the specified pattern. |
Method Summary | |
---|---|
NumberFormat |
getNumberFormat(Locale locale)
Obtain a concrete NumberFormat for the specified locale. |
void |
setPattern(String pattern)
Sets the pattern to use to format number values. |
Methods inherited from class org.springframework.format.number.AbstractNumberFormatter |
---|
parse, print, setLenient |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NumberFormatter()
public NumberFormatter(String pattern)
pattern
- the format patternsetPattern(java.lang.String)
Method Detail |
---|
public void setPattern(String pattern)
DecimalFormat.applyPattern(String)
public NumberFormat getNumberFormat(Locale locale)
AbstractNumberFormatter
getNumberFormat
in class AbstractNumberFormatter
locale
- the current locale
null
)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |