public class DecimalFormat extends Object
Constructor and Description |
---|
DecimalFormat(int maxInteger,
int minInteger,
int maxFraction,
int minFraction,
boolean showThousands,
boolean showCurrency) |
Modifier and Type | Method and Description |
---|---|
static DecimalFormat |
getFor(String format)
Get a DecimalFormat for the provided format String.
|
int |
getMaxFractionDigits() |
int |
getMaxIntegerDigits() |
int |
getMinFractionDigits() |
int |
getMinIntegerDigits() |
public DecimalFormat(int maxInteger, int minInteger, int maxFraction, int minFraction, boolean showThousands, boolean showCurrency)
maxInteger
- the maximum number of integer digits, use -1 to indicate
no maximium.minInteger
- the minimum number of integer digts.maxFraction
- the maximum number of fractional digits, use -1 to indicate
no maximium.minFraction
- the minimum number of factional digits.showThousands
- true to show thousand groupings.showCurrency
- true to show the currency character.public int getMaxIntegerDigits()
public int getMaxFractionDigits()
public int getMinIntegerDigits()
public int getMinFractionDigits()
public static DecimalFormat getFor(String format) throws IllegalArgumentException
f
- the format String in the form "##00.00##". A '0' indicates
that a digit must be placed there. A '#' indicates that if the digit
value there is insignificant it may be left out. The total number
before or after the decimal point indicate the maximum number of allowed
digits for that portion.
A ',' in the format indicates that Thousand groupings should be used.
A '$' indicates that currency symbol should be shown.IllegalArgumentException