| java.lang.Object java.text.Format gnu.math.ExponentialFormat
ExponentialFormat | public class ExponentialFormat extends java.text.Format (Code) | | 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.
|
Field Summary | |
final static double | LOG10 | 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 |
Method Summary | |
static boolean | addOne(StringBuffer sbuf, int digStart, int digEnd) Add 1 to the integer in sbuf from digStart to digEnd.
if we overflowed. | public StringBuffer | format(float value, StringBuffer sbuf, FieldPosition fpos) | public StringBuffer | format(double value, StringBuffer sbuf, FieldPosition fpos) | StringBuffer | format(double value, String dstr, StringBuffer sbuf, FieldPosition fpos) | public StringBuffer | format(long num, StringBuffer sbuf, FieldPosition fpos) | public StringBuffer | format(Object num, StringBuffer sbuf, FieldPosition fpos) | public java.lang.Number | parse(String text, java.text.ParsePosition status) | public Object | parseObject(String text, java.text.ParsePosition status) |
LOG10 | final static double LOG10(Code) | | |
expDigits | public int expDigits(Code) | | Number of digits to show in the exponent.
Zero means unspecified - show as many as needed.
|
exponentChar | public char exponentChar(Code) | | |
exponentShowSign | public boolean exponentShowSign(Code) | | Display sign of exponent even when it is non-negative.
|
fracDigits | public int fracDigits(Code) | | Number of fractional digits to show.
This is `d' in the CommonLisp spec.
|
general | public boolean general(Code) | | |
intDigits | public int intDigits(Code) | | 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(Code) | | |
padChar | public char padChar(Code) | | |
showPlus | public boolean showPlus(Code) | | True if '+' should be printed for non-negative number.
|
addOne | static boolean addOne(StringBuffer sbuf, int digStart, int digEnd)(Code) | | Add 1 to the integer in sbuf from digStart to digEnd.
if we overflowed. |
|
|