public class OrdinateFormat extends Object
The format has the following characteristics:
Modifier and Type | Field and Description |
---|---|
static OrdinateFormat |
DEFAULT
The default formatter using the maximum number of digits in the fraction portion of a number.
|
static int |
MAX_FRACTION_DIGITS
The maximum number of fraction digits to support output of reasonable ordinate values.
|
static String |
REP_NAN
The output representation of
Double.NaN |
static String |
REP_NEG_INF
The output representation of
Double.NEGATIVE_INFINITY |
static String |
REP_POS_INF
The output representation of
Double.POSITIVE_INFINITY |
Constructor and Description |
---|
OrdinateFormat()
Creates an OrdinateFormat using the default maximum number of fraction digits.
|
OrdinateFormat(int maximumFractionDigits)
Creates an OrdinateFormat using the given maximum number of fraction digits.
|
Modifier and Type | Method and Description |
---|---|
static OrdinateFormat |
create(int maximumFractionDigits)
Creates a new formatter with the given maximum number of digits in the fraction portion of a number.
|
String |
format(double ord)
Returns a string representation of the given ordinate numeric value.
|
public static final String REP_POS_INF
Double.POSITIVE_INFINITY
public static final String REP_NEG_INF
Double.NEGATIVE_INFINITY
public static final String REP_NAN
Double.NaN
public static final int MAX_FRACTION_DIGITS
public static OrdinateFormat DEFAULT
public OrdinateFormat()
public OrdinateFormat(int maximumFractionDigits)
maximumFractionDigits
- the maximum number of fraction digits to outputpublic static OrdinateFormat create(int maximumFractionDigits)
maximumFractionDigits
- the maximum number of fraction digits to outputpublic String format(double ord)
ord
- the ordinate valueCopyright © 2024. All rights reserved.