gnu.math
Class ExponentialFormat
public
class
ExponentialFormat
extends 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.
Method Summary |
StringBuffer | format(float value, StringBuffer sbuf, FieldPosition fpos) |
StringBuffer | format(double value, StringBuffer sbuf, FieldPosition fpos) |
StringBuffer | format(long num, StringBuffer sbuf, FieldPosition fpos) |
StringBuffer | format(Object num, StringBuffer sbuf, FieldPosition fpos) |
Number | parse(String text, ParsePosition status) |
Object | parseObject(String text, ParsePosition status) |
public int expDigits
Number of digits to show in the exponent.
Zero means unspecified - show as many as needed.
public char exponentChar
public boolean exponentShowSign
Display sign of exponent even when it is non-negative.
public int fracDigits
Number of fractional digits to show.
This is `d' in the CommonLisp spec.
public boolean general
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.
public char overflowChar
public char padChar
public boolean showPlus
True if '+' should be printed for non-negative number.
public int width
public StringBuffer format(float value, StringBuffer sbuf, FieldPosition fpos)
public StringBuffer format(double value, StringBuffer sbuf, FieldPosition fpos)
public StringBuffer format(long num, StringBuffer sbuf, FieldPosition fpos)
public StringBuffer format(Object num, StringBuffer sbuf, FieldPosition fpos)
public Number parse(String text, ParsePosition status)
public Object parseObject(String text, ParsePosition status)