Class ScientificNumberFormat
java.lang.Object
java.text.Format
java.text.NumberFormat
com.inductiveautomation.ignition.common.util.ScientificNumberFormat
- All Implemented Interfaces:
- Serializable,- Cloneable
A number format that will switch between a "small" and "large" format depending on the magnitude of the value. If the
 magnitude of the to-be-formatted value is below a settable threshold, then the small format will be used. Otherwise,
 and if the value is exactly equal to 0.0, the large format will be used.
- See Also:
- 
Nested Class SummaryNested classes/interfaces inherited from class java.text.NumberFormatNumberFormat.Field, NumberFormat.Style
- 
Field SummaryFields inherited from class java.text.NumberFormatFRACTION_FIELD, INTEGER_FIELD
- 
Constructor SummaryConstructorsConstructorDescriptionCreates a Scientific number format with 10 significant digits and a threshold of 0.0001ScientificNumberFormat(int significantDigits, double threshold) Creates a scientific number format with any number of significant digits and a custom thresholdScientificNumberFormat(String largeFormat, String smallFormat, double threshold) Creates a scientific number format with custom large and small formats
- 
Method SummaryModifier and TypeMethodDescriptionCreates an editor that uses this formatter as its decimal formatformat(double number, StringBuffer toAppendTo, FieldPosition pos) format(long number, StringBuffer toAppendTo, FieldPosition pos) static ScientificNumberFormatparse(String source, ParsePosition parsePosition) Methods inherited from class java.text.NumberFormatclone, 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, setRoundingModeMethods inherited from class java.text.Formatformat, formatToCharacterIterator, parseObject
- 
Constructor Details- 
ScientificNumberFormatpublic ScientificNumberFormat()Creates a Scientific number format with 10 significant digits and a threshold of 0.0001
- 
ScientificNumberFormatpublic ScientificNumberFormat(int significantDigits, double threshold) Creates a scientific number format with any number of significant digits and a custom threshold
- 
ScientificNumberFormatCreates a scientific number format with custom large and small formats
 
- 
- 
Method Details
- 
format- Specified by:
- formatin class- NumberFormat
 
- 
format- Specified by:
- formatin class- NumberFormat
 
- 
parse- Specified by:
- parsein class- NumberFormat
 
- 
createEditorCreates an editor that uses this formatter as its decimal format