Package com.e1c.langtool.stat
Class StatisticsUtil
java.lang.Object
com.e1c.langtool.stat.StatisticsUtil
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Constant for full statistic metric.static final StringThe Constant of default metrics order, separated byMETRIC_ORDER_DELIMITERwithout spacesstatic final StringThe Constant for interface statistic metric.static final StringMetric order delimiter.static final StringThe Constant for model statistic metric.static final StringThe prefix key metric order -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringformatStatisticCount(float value) Formats the given floating-point value to a string with two decimal places, rounding down as necessary.
-
Field Details
-
ALL_PLACE_COUNT
The Constant for full statistic metric.- See Also:
-
MODEL_PLACE_COUNT
The Constant for model statistic metric.- See Also:
-
INTERFACE_PLACE_COUNT
The Constant for interface statistic metric.- See Also:
-
METRIC_ORDER_DELIMITER
Metric order delimiter.- See Also:
-
DEFAUTL_METRIC_ORDER
The Constant of default metrics order, separated byMETRIC_ORDER_DELIMITERwithout spaces -
PREF_KEY_METRIC_ORDER
The prefix key metric order- See Also:
-
-
Constructor Details
-
StatisticsUtil
public StatisticsUtil()
-
-
Method Details
-
formatStatisticCount
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.
-