Package gnu.math
Class ExponentialFormat
java.lang.Object
java.text.Format
gnu.math.ExponentialFormat
- All Implemented Interfaces:
Serializable
,Cloneable
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.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.Format
Format.Field
-
Field Summary
FieldsModifier and TypeFieldDescriptionint
Number of digits to show in the exponent.char
boolean
Display sign of exponent even when it is non-negative.int
Number of fractional digits to show.boolean
int
Number of digits to show in the integer part of the result.char
char
boolean
True if '+' should be printed for non-negative number.char
'L': Common Lisp style; 'P' C/Java printf-style.int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat
(double value, StringBuffer sbuf, FieldPosition fpos) format
(float value, StringBuffer sbuf, FieldPosition fpos) format
(long num, StringBuffer sbuf, FieldPosition fpos) format
(Object num, StringBuffer sbuf, FieldPosition fpos) parse
(String text, ParsePosition status) parseObject
(String text, ParsePosition status) Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
-
Field Details
-
fracDigits
public int fracDigitsNumber of fractional digits to show. This is `d' in the CommonLisp spec. -
intDigits
public int intDigitsNumber 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. -
expDigits
public int expDigitsNumber of digits to show in the exponent. Zero means unspecified - show as many as needed. -
overflowChar
public char overflowChar -
padChar
public char padChar -
exponentChar
public char exponentChar -
exponentShowSign
public boolean exponentShowSignDisplay sign of exponent even when it is non-negative. -
showPlus
public boolean showPlusTrue if '+' should be printed for non-negative number. -
general
public boolean general -
style
public char style'L': Common Lisp style; 'P' C/Java printf-style. Used for fine points of printing 'g' style. -
width
public int width
-
-
Constructor Details
-
ExponentialFormat
public ExponentialFormat()
-
-
Method Details
-
format
-
format
-
format
-
format
-
parse
-
parseObject
- Specified by:
parseObject
in classFormat
-