IStatFormatter - friendlyhj/ZenUtils GitHub Wiki
An IStatFormatter describes how to display stat amount to Statistics menu.
You'd better import the package to avoid errors and write script easier.
Class Name: mods.zenutils.IStatFormatter
The IStatFormatter is a function interface. It has an int parameter and requires a string return value for display text.
These below are pre-registered IStatFormatters by zenutils. You can call these method to get them. For example: IStatFormatter.time()
.
- simple: display an integer with digit group separators. This is the default behavior.
- time: display as time format
- distance: display as length units
- divideByTen: divides the value by ten and displays then
The following methods can be used in custom formatter.
Formats an integer with digit group separators. Returns a string
IStatFormatter.numberFormat(int amount);
Formats a decimal with 2 decimal digits.
IStatFormatter.decimalFormat(double amount);