Package org.orekit.utils
Class AccurateFormatter
java.lang.Object
org.orekit.utils.AccurateFormatter
- All Implemented Interfaces:
Formatter
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 inherited from interface org.orekit.utils.Formatter
DATE_FORMAT, STANDARDIZED_LOCALE -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
AccurateFormatter
public AccurateFormatter()Public constructor.
-
-
Method Details
-
toString
Formats to full accuracy. Format a double number. -
toString
Formats the seconds variable with maximum precision needed. Format a date. Does not check if date time is real or if it will meet formating requirements.- Specified by:
toStringin interfaceFormatter- Parameters:
year- of date to be formattedmonth- of date to be formattedday- of month to be formattedhour- to be formattedminute- to be formattedseconds- and sub-seconds to be formatted- Returns:
- date formatted to match the following format [yyyy-MM-ddTHH:mm:ss.S#]
-