public final class NumberFormatter extends AbstractCellFormatter
| Modifier and Type | Field and Description |
|---|---|
static CellFormatter |
INTEGER
An instance of this class that formats as integers (no decimal places).
|
static CellFormatter |
TO_5DP
An instance of this class that formats to 5 decimal places.
|
EMPTY, OX, QUERY, SLASH, SPACE, UNDERSCORE| Constructor and Description |
|---|
NumberFormatter()
Creates a formatter using the default format (no decimal places).
|
NumberFormatter(NumberFormat format)
Creates a formatter using the specified
NumberFormat. |
NumberFormatter(String decimalFormat)
Creates a formatter using a
DecimalFormat configured with the
given format string. |
| Modifier and Type | Method and Description |
|---|---|
protected String |
nonNullFormat(Object value)
Formats the specified value into a string appropriate for displaying
in a table cell.
|
formatpublic static final CellFormatter INTEGER
12345 formatted as "12,345"
public static final CellFormatter TO_5DP
12.3 formatted as "12.30000"
1234 formatted as "1,234.00000"
public NumberFormatter()
12345 formatted as "12,345"
public NumberFormatter(String decimalFormat)
DecimalFormat configured with the
given format string.decimalFormat - the format stringpublic NumberFormatter(NumberFormat format)
NumberFormat.format - number formatprotected String nonNullFormat(Object value)
AbstractCellFormatternonNullFormat in class AbstractCellFormattervalue - the value