|
EspressReport v 5.5 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--quadbase.reportdesigner.util.NumericFormat
NumericFormat
NumericalFormat is a utility class to format numeric value. You can specify the no of decimal point, currency symbol, thousand separator etc.
LocaleNumericFormat| Field Summary | |
int |
currencyPos
currency position, 0 - before number (default), 1 - after negative sign, 2 - after number . |
char |
currencySymbol
currency symbol, default none |
int |
decimal
decimal point, range from 1 to 6, default 2 |
char |
decimalSep
decimal point char, default '.' |
boolean |
leadingZero
leading zero, 0 or 1 |
int |
negative
negative position, 0 - before currency sign (default), 1 - after currency sign, 2 - end of number |
boolean |
oneSymPerPage
Deprecated. not used. |
int |
rounding
no. |
boolean |
sciExp
either 0 or 1, invalid when not currency, default 0 |
char |
thousandSep
thousand separator, if 'N' means no thousand separator. |
| Fields inherited from interface quadbase.reportdesigner.util.IFormat |
BARCODE, DATETIME, IMAGEURL, LOCALEDATETIME, LOCALENUMERIC, LOGICAL, NUMERIC, STRING, TEXTURL |
| Constructor Summary | |
NumericFormat()
Create a new numeric format with default values |
|
| Method Summary | |
java.lang.String |
format(java.lang.Object obj)
Define quadbase.reportdesigner.util.IFormat Use the doubleValue() method in java.lang.Number to return a formatted string If the target object is not an instance of Number, use the default toString() method |
int |
getFormatType()
Define quadbase.reportdesigner.util.IFormat Return the type of quadbase.reportdesigner.util.IFormat |
java.lang.String |
output(double d)
Output the formatted number |
void |
setDefault()
Set all variables to default value |
void |
setFormat(char currSymInit,
boolean oneSymPerPageInit,
int currencyPosInit,
int decimalInit,
int roundingInit,
int negativeInit,
char decimalSepInit,
char thousandSepInit,
boolean leadingZeroInit)
Set Numeric format |
void |
setScientifExp(int precision)
Set scientific expression |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public boolean sciExp
public char currencySymbol
public boolean oneSymPerPage
public int currencyPos
public int decimal
public int rounding
public int negative
public char decimalSep
public char thousandSep
public boolean leadingZero
| Constructor Detail |
public NumericFormat()
| Method Detail |
public int getFormatType()
getFormatType in interface IFormatpublic java.lang.String format(java.lang.Object obj)
format in interface IFormatobj - The target objectpublic void setDefault()
public void setScientifExp(int precision)
precision - no of decimal point
public void setFormat(char currSymInit,
boolean oneSymPerPageInit,
int currencyPosInit,
int decimalInit,
int roundingInit,
int negativeInit,
char decimalSepInit,
char thousandSepInit,
boolean leadingZeroInit)
currSymInit - currency symboloneSymPerPageInit - not used, always set to falsecurrencyPosInit - currency position 0-2decimalInit - no. of decimal pointroundingInit - no. of significant digitnegativeInit - negative symbol position 0-2decimalSepInit - decimal point symbolthoudsandSepInit - thousands separator symbol, 'N' means no thousands separatorleadingZeroInit - leading zeropublic java.lang.String output(double d)
d - number to be formatted
|
EspressReport v 5.5 |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||