Class StatisticsUtil

java.lang.Object
com.e1c.langtool.stat.StatisticsUtil

public class StatisticsUtil extends Object
Utility class for formatting floating-point numbers with specific rounding rules. This class provides a method to format numbers to a fixed number of decimal places without rounding them up.

The formatting behavior is defined by a DecimalFormat instance that rounds numbers down (towards zero) using RoundingMode.FLOOR. The formatted numbers are always displayed with two decimal places.

  • Field Details

    • ALL_PLACE_COUNT

      public static final String ALL_PLACE_COUNT
      The Constant for full statistic metric.
      See Also:
    • MODEL_PLACE_COUNT

      public static final String MODEL_PLACE_COUNT
      The Constant for model statistic metric.
      See Also:
    • INTERFACE_PLACE_COUNT

      public static final String INTERFACE_PLACE_COUNT
      The Constant for interface statistic metric.
      See Also:
    • METRIC_ORDER_DELIMITER

      public static final String METRIC_ORDER_DELIMITER
      Metric order delimiter.
      See Also:
    • DEFAUTL_METRIC_ORDER

      public static final String DEFAUTL_METRIC_ORDER
      The Constant of default metrics order, separated by METRIC_ORDER_DELIMITER without spaces
    • PREF_KEY_METRIC_ORDER

      public static final String PREF_KEY_METRIC_ORDER
      The prefix key metric order
      See Also:
  • Constructor Details

    • StatisticsUtil

      public StatisticsUtil()
  • Method Details

    • formatStatisticCount

      public static String formatStatisticCount(float value)
      Formats the given floating-point value to a string with two decimal places, rounding down as necessary.
      Parameters:
      value - The floating-point number to format.
      Returns:
      A string representation of the given value, rounded down to two decimal places.