Class Converter


  • public class Converter
    extends Object
    • Constructor Detail

      • Converter

        public Converter()
    • Method Detail

      • convertNs

        public static long convertNs​(long time,
                                     String format)
        Converts a time value into the specified time format.
        Parameters:
        time - The time in nanoseconds.
        format - The format of the time (Nanoseconds, Microseconds, Milliseconds, Seconds).
        Returns:
        The time in the specified format.
      • round

        public static double round​(double value,
                                   int places)
        Rounds a given number to n decimal places using the BigDecimal.ROUND_HALF_UP method.
        Parameters:
        value - number to round
        places - decimal places
        Returns:
        rounded number