Class Formatter

java.lang.Object
de.uni_trier.wi2.procake.utils.Formatter

public class Formatter extends Object
  • Field Details

  • Constructor Details

    • Formatter

      public Formatter()
  • Method Details

    • 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