Package de.uni_trier.wi2.procake.utils
Class Formatter
java.lang.Object
de.uni_trier.wi2.procake.utils.Formatter
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
nsToDetailedString
(long ns) Returns a string representation of the given number of nanoseconds.static String
nsToString
(long ns) Returns a string representation of the given number of nanoseconds.static String
nsToString
(long time, String format) Returns a string representation of the given number in a specified format.static String
toRoundedNumberWithDecimalComma
(double number, int maxFractionDigits) Returns a string representation of the given number with german locale, i.e., decimal comma.
-
Field Details
-
NANOSECONDS
- See Also:
-
MICROSECONDS
- See Also:
-
MILLISECONDS
- See Also:
-
SECONDS
- See Also:
-
-
Constructor Details
-
Formatter
public Formatter()
-
-
Method Details
-
nsToString
Returns a string representation of the given number of nanoseconds. -
nsToString
Returns a string representation of the given number in a specified format.- Parameters:
time
- The time in nanoseconds.format
- The format of the time (Nanoseconds, Microseconds, Milliseconds, Seconds).- Returns:
- The time in the specified format.
-
nsToDetailedString
Returns a string representation of the given number of nanoseconds. -
toRoundedNumberWithDecimalComma
Returns a string representation of the given number with german locale, i.e., decimal comma.- Parameters:
number
- to be formattedmaxFractionDigits
- the maximum number of fraction digits to be shown; if * less than zero, the number is not rounded.- Returns:
- string representation
-