Class Formatter


  • public class Formatter
    extends Object
    • Constructor Detail

      • Formatter

        public Formatter()
    • Method Detail

      • nsToString

        public static String nsToString​(long ns)
        Returns a string representation of the given number of nanoseconds.
      • nsToString

        public static String nsToString​(long time,
                                        String format)
        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

        public static String nsToDetailedString​(long ns)
        Returns a string representation of the given number of nanoseconds.
      • toRoundedNumberWithDecimalComma

        public static String toRoundedNumberWithDecimalComma​(double number,
                                                             int maxFractionDigits)
        Returns a string representation of the given number with german locale, i.e., decimal comma.
        Parameters:
        number - to be formatted
        maxFractionDigits - the maximum number of fraction digits to be shown; if * less than zero, the number is not rounded.
        Returns:
        string representation