Class ScientificNumberFormat
- java.lang.Object
- 
- java.text.Format
- 
- java.text.NumberFormat
- 
- com.inductiveautomation.ignition.common.util.ScientificNumberFormat
 
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.lang.Cloneable
 
 public class ScientificNumberFormat extends java.text.NumberFormatA 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:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description ScientificNumberFormat()Creates 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(java.lang.String largeFormat, java.lang.String smallFormat, double threshold)Creates a scientific number format with custom large and small formats
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JFormattedTextFieldcreateEditor()Creates an editor that uses this formatter as its decimal formatjava.lang.StringBufferformat(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)java.lang.StringBufferformat(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)static ScientificNumberFormatgetShared()java.lang.Numberparse(java.lang.String source, java.text.ParsePosition parsePosition)- 
Methods inherited from class java.text.NumberFormatclone, equals, format, format, format, getAvailableLocales, 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
 
- 
 
- 
- 
- 
Constructor Detail- 
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
 - 
ScientificNumberFormatpublic ScientificNumberFormat(java.lang.String largeFormat, java.lang.String smallFormat, double threshold)Creates a scientific number format with custom large and small formats
 
- 
 - 
Method Detail- 
getSharedpublic static ScientificNumberFormat getShared() 
 - 
formatpublic java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)- Specified by:
- formatin class- java.text.NumberFormat
 
 - 
formatpublic java.lang.StringBuffer format(long number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)- Specified by:
- formatin class- java.text.NumberFormat
 
 - 
parsepublic java.lang.Number parse(java.lang.String source, java.text.ParsePosition parsePosition)- Specified by:
- parsein class- java.text.NumberFormat
 
 - 
createEditorpublic javax.swing.JFormattedTextField createEditor() Creates an editor that uses this formatter as its decimal format
 
- 
 
-