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(java.text.NumberFormat format)
Creates a formatter using the specified
NumberFormat . |
NumberFormatter(java.lang.String decimalFormat)
Creates a formatter using a
DecimalFormat configured with the
given format string. |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
nonNullFormat(java.lang.Object value)
Formats the specified value into a string appropriate for displaying
in a table cell.
|
format
public 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(java.lang.String decimalFormat)
DecimalFormat
configured with the
given format string.decimalFormat
- the format stringpublic NumberFormatter(java.text.NumberFormat format)
NumberFormat
.format
- number formatprotected java.lang.String nonNullFormat(java.lang.Object value)
AbstractCellFormatter
nonNullFormat
in class AbstractCellFormatter
value
- the value