public class FloatingPointFormat
extends java.text.DecimalFormat
Modifier and Type | Field and Description |
---|---|
protected int |
decimal
Decimal size.
|
protected java.text.DecimalFormat |
nf
Decimal format.
|
protected boolean |
trailing
Trailing flag.
|
protected int |
width
Total width of the integer number.
|
Constructor and Description |
---|
FloatingPointFormat()
Default constructor.
|
FloatingPointFormat(int digits)
Constructor.
|
FloatingPointFormat(int w,
int d)
Constructor.
|
FloatingPointFormat(int w,
int d,
boolean trailingZeros)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.StringBuffer |
format(double number,
java.lang.StringBuffer toAppendTo,
java.text.FieldPosition pos) |
static java.lang.String |
pattern(int w,
int d)
Generates a pattern with the given width and decimal size parameters.
|
int |
width()
Returns the width of the 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 int width
protected int decimal
protected boolean trailing
public FloatingPointFormat()
public FloatingPointFormat(int digits)
digits
- given digits.public FloatingPointFormat(int w, int d)
w
- width given.d
- decimal size given.public FloatingPointFormat(int w, int d, boolean trailingZeros)
w
- width given.d
- decimal size given.trailingZeros
- trailing with zeros flag.public java.lang.StringBuffer format(double number, java.lang.StringBuffer toAppendTo, java.text.FieldPosition pos)
format
in class java.text.DecimalFormat
public static java.lang.String pattern(int w, int d)
w
- given width.d
- given decimal size.public int width()