public class AdaptiveNumberFormatter extends NumberFormatter
Modifier and Type | Field and Description |
---|---|
private int |
precision |
Constructor and Description |
---|
AdaptiveNumberFormatter(int precision,
boolean doubleValues)
Create a new number formatter.
|
Modifier and Type | Method and Description |
---|---|
String |
format(Number value)
Format a value by converting it to a string.
|
parseString
public AdaptiveNumberFormatter(int precision, boolean doubleValues)
precision
- The number of decimals to display for values
between 1 and 10 (for lower and higher values the number of decimals is
adjusted), or a negative value to display all decimalsdoubleValues
- If the NumberFormatter.parseString(String)
should return double
or float valuesValues.formatNumber(Float, int)