Package io.deephaven.plot.axisformatters
Class ScientificNumberFormatter
java.lang.Object
java.text.Format
java.text.NumberFormat
io.deephaven.plot.axisformatters.ScientificNumberFormatter
- All Implemented Interfaces:
Serializable
,Cloneable
NumberFormat
which formats numbers in scientific notation if they are outside the given range.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.NumberFormat
NumberFormat.Field, NumberFormat.Style
-
Field Summary
Fields inherited from class java.text.NumberFormat
FRACTION_FIELD, INTEGER_FIELD
-
Constructor Summary
ConstructorDescriptionCreates a ScientificNumberFormatter instance with the default number of decimals, lower limit, and upper limit.ScientificNumberFormatter
(int numDecimals, double lowerLimit, double upperLimit) Creates a ScientificNumberFormatter instance. -
Method Summary
Modifier and TypeMethodDescriptionformat
(double number, StringBuffer toAppendTo, FieldPosition pos) format
(long number, StringBuffer toAppendTo, FieldPosition pos) parse
(String source, ParsePosition parsePosition) Methods inherited from class java.text.NumberFormat
clone, equals, format, format, format, getAvailableLocales, getCompactNumberInstance, getCompactNumberInstance, getCurrency, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, getRoundingMode, hashCode, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setCurrency, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setParseIntegerOnly, setRoundingMode
Methods inherited from class java.text.Format
format, formatToCharacterIterator, parseObject
-
Constructor Details
-
ScientificNumberFormatter
public ScientificNumberFormatter()Creates a ScientificNumberFormatter instance with the default number of decimals, lower limit, and upper limit. -
ScientificNumberFormatter
public ScientificNumberFormatter(int numDecimals, double lowerLimit, double upperLimit) Creates a ScientificNumberFormatter instance.- Parameters:
numDecimals
- the max number of decimals to displaylowerLimit
- gives a range around 0 [-lowerLimit, lowerLimit] for which each number inside the range excluding 0 will be formatted with scientific notationupperLimit
- gives a range around 0 [-upperLimit, upperLimit] for which each number outside the range will be formatted with scientific notation
-
-
Method Details
-
format
- Specified by:
format
in classNumberFormat
-
format
- Specified by:
format
in classNumberFormat
-
parse
- Specified by:
parse
in classNumberFormat
-