Class Formatter


  • public class Formatter
    extends java.lang.Object
    Utility class for formatting values into strings.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.lang.String formatFloat​(double value, int digits)
      Formats a float value for display.
      static @NotNull java.lang.String formatLong​(long value)
      Returns a long value formatted as a human readable string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • formatLong

        @NotNull
        public static @NotNull java.lang.String formatLong​(long value)
        Returns a long value formatted as a human readable string.
        Parameters:
        value - the value
        Returns:
        return the formatted value
      • formatFloat

        @NotNull
        public static @NotNull java.lang.String formatFloat​(double value,
                                                            int digits)
        Formats a float value for display.
        Parameters:
        value - the float value
        digits - the number of fraction digits; must be between 1..3 inclusive
        Returns:
        the formatted value