Class OrdinateFormat

Hierarchy: Object , OrdinateFormat
public class OrdinateFormat
Formats numeric values for ordinates in a consistent, accurate way.

The format has the following characteristics:

  • It is consistent in all locales (in particular, the decimal separator is always a period)
  • Scientific notation is never output, even for very large numbers. This means that it is possible that output can contain a large number of digits.
  • The maximum number of decimal places reflects the available precision
  • NaN values are represented as "NaN"
  • Inf values are represented as "Inf" or "-Inf"
Authors:
mdavis
public OrdinateFormat()
Creates an OrdinateFormat using the default maximum number of fraction digits.
public OrdinateFormat(int maximumFractionDigits)
Creates an OrdinateFormat using the given maximum number of fraction digits.
Parameters:
maximumFractionDigits - maximumFractionDigits the maximum number of fraction digits to output
public static OrdinateFormat create(int maximumFractionDigits)
Creates a new formatter with the given maximum number of digits in the fraction portion of a number.
Parameters:
maximumFractionDigits - maximumFractionDigits the maximum number of fraction digits to output
Returns:
a formatter
public synchronized String format(double ord)
Returns a string representation of the given ordinate numeric value.
Parameters:
ord - ord the ordinate value
Returns:
the formatted number string