gnu.math
Class ExponentialFormat
java.text.Format
gnu.math.ExponentialFormat
public class ExponentialFormat
extends java.text.Format
Format a real number using a floating-point format.
However, if `general' is true, and the number "fits",
use a fixed-point format (like printf %g).
Used for Common Lisp specs ~E and ~G; also C-style %e and %g.
StringBuffer | format(Object num, StringBuffer sbuf, FieldPosition fpos)
|
StringBuffer | format(double value, StringBuffer sbuf, FieldPosition fpos)
|
StringBuffer | format(float value, StringBuffer sbuf, FieldPosition fpos)
|
StringBuffer | format(long num, StringBuffer sbuf, FieldPosition fpos)
|
java.lang.Number | parse(String text, java.text.ParsePosition status)
|
Object | parseObject(String text, java.text.ParsePosition status)
|
expDigits
public int expDigits
Number of digits to show in the exponent.
Zero means unspecified - show as many as needed.
exponentChar
public char exponentChar
exponentShowSign
public boolean exponentShowSign
Display sign of exponent even when it is non-negative.
fracDigits
public int fracDigits
Number of fractional digits to show.
This is `d' in the CommonLisp spec.
general
public boolean general
intDigits
public int intDigits
Number of digits to show in the integer part of the result.
If positive, The number of digits before the decimal point.
If negative, the -intDigits zeros are emitted after the decimal point.
This is `k' in the CommonLisp spec.
overflowChar
public char overflowChar
padChar
public char padChar
showPlus
public boolean showPlus
True if '+' should be printed for non-negative number.
format
public StringBuffer format(Object num,
StringBuffer sbuf,
FieldPosition fpos)
format
public StringBuffer format(double value,
StringBuffer sbuf,
FieldPosition fpos)
format
public StringBuffer format(float value,
StringBuffer sbuf,
FieldPosition fpos)
format
public StringBuffer format(long num,
StringBuffer sbuf,
FieldPosition fpos)
parse
public java.lang.Number parse(String text,
java.text.ParsePosition status)
parseObject
public Object parseObject(String text,
java.text.ParsePosition status)