public class ExponentialFormat
extends java.text.DecimalFormat
ExponentialFormat
is a concrete subclass of
DecimalFormat
that formats exponential numbers. It has a variety of
features designed to make it possible to parse and format exponential numbers in any
locale, including support for Western, Arabic, and Indic digits.Modifier and Type | Field and Description |
---|---|
protected int |
digits
Number of digits of the base.
|
protected int |
exp
Exponent size.
|
protected java.text.DecimalFormat |
nf
Decimal format of this exponential one.
|
protected boolean |
sign
Sign flag.
|
protected boolean |
trailing
Trailing flag.
|
Constructor and Description |
---|
ExponentialFormat()
Default constructor.
|
ExponentialFormat(int digits)
Constructor.
|
ExponentialFormat(int digits,
boolean trailing)
Constructor.
|
ExponentialFormat(int digits,
int exp,
boolean sign,
boolean trailing)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuffer |
format(double number,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos) |
int |
width()
Returns the width of the exponential numbers format.
|
applyLocalizedPattern, applyPattern, clone, equals, format, format, formatToCharacterIterator, getCurrency, getDecimalFormatSymbols, getGroupingSize, getMaximumFractionDigits, getMaximumIntegerDigits, getMinimumFractionDigits, getMinimumIntegerDigits, getMultiplier, getNegativePrefix, getNegativeSuffix, getPositivePrefix, getPositiveSuffix, getRoundingMode, hashCode, isDecimalSeparatorAlwaysShown, isParseBigDecimal, parse, setCurrency, setDecimalFormatSymbols, setDecimalSeparatorAlwaysShown, setGroupingSize, setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits, setMinimumFractionDigits, setMinimumIntegerDigits, setMultiplier, setNegativePrefix, setNegativeSuffix, setParseBigDecimal, setPositivePrefix, setPositiveSuffix, setRoundingMode, toLocalizedPattern, toPattern
format, format, getAvailableLocales, getCurrencyInstance, getCurrencyInstance, getInstance, getInstance, getIntegerInstance, getIntegerInstance, getNumberInstance, getNumberInstance, getPercentInstance, getPercentInstance, isGroupingUsed, isParseIntegerOnly, parse, parseObject, setParseIntegerOnly
protected java.text.DecimalFormat nf
protected boolean sign
protected int digits
protected int exp
protected boolean trailing
public ExponentialFormat()
public ExponentialFormat(int digits)
digits
- given base size.public ExponentialFormat(int digits, boolean trailing)
digits
- given base size.trailing
- given trailing flag.public ExponentialFormat(int digits, int exp, boolean sign, boolean trailing)
digits
- given base size.exp
- given exponent size.sign
- given sign flag.trailing
- given trailing flag.public int width()
public java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
format
in class java.text.DecimalFormat