Package org.orekit.utils
Class AccurateFormatter
- java.lang.Object
-
- org.orekit.utils.AccurateFormatter
-
public class AccurateFormatter extends Object
Formatter used to produce strings from data with high accuracy.When producing test output from computed data, we want the shortest decimal representation of a floating point number that maintains round-trip safety. That is, a correct parser can recover the exact original number.
For efficiency, this class uses the
Ryƫ
algorithm for producing shortest string representation with round-trip safety.- Since:
- 11.0
- Author:
- Luc Maisonobe
-
-
Field Summary
Fields Modifier and Type Field Description static Locale
STANDARDIZED_LOCALE
Standardized locale to use, to ensure files can be exchanged without internationalization issues.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
format(double value)
Format a double number.static String
format(int year, int month, int day, int hour, int minute, double seconds)
Format a date.
-
-
-
Field Detail
-
STANDARDIZED_LOCALE
public static final Locale STANDARDIZED_LOCALE
Standardized locale to use, to ensure files can be exchanged without internationalization issues.
-
-
Method Detail
-
format
public static String format(double value)
Format a double number.- Parameters:
value
- number to format- Returns:
- number formatted to full accuracy
-
format
public static String format(int year, int month, int day, int hour, int minute, double seconds)
Format a date.- Parameters:
year
- yearmonth
- monthday
- dayhour
- hourminute
- minuteseconds
- seconds- Returns:
- date formatted to full accuracy
-
-