public final class Number extends Object implements Format
NumberFormat
with grouping.Modifier and Type | Field and Description |
---|---|
private NumberFormat |
numberFormat
Number formatter.
|
Constructor and Description |
---|
Number()
Create number formatter with default locale settings.
|
Number(Locale locale)
Create number formatter with given locale settings.
|
Modifier and Type | Method and Description |
---|---|
String |
format(Object value)
Format numeric value using this formatter locale settings.
|
Object |
parse(String value)
Parse string numeric value accordingly this formatter locale.
|
private NumberFormat numberFormat
public Number()
public Number(Locale locale)
locale
- locale settings.public String format(Object value)
value
argument is
null.format
in interface Format
value
- numeric value.value
argument is null.IllegalArgumentException
- if value
argument is not an instance of Number.public Object parse(String value) throws ParseException
Number
instance. Returns null if
value
argument is null or empty.parse
in interface Format
value
- locale numeric value.Number
instance, possible null.ParseException
- if value
argument does not represent a number accordingly this formatter locale.Copyright © 2018. All rights reserved.