|
Drag[en]gine Script Module DragonScript 1.35
|
Provides common text formatting support for UI. More...
Public Member Functions | |
| String | formatCount (float count) |
| Format count. | |
| String | formatCount (float count, int digits) |
| Format count with custom digit count. | |
| String | formatPercentage (float percentage) |
| Format percentage. | |
| String | formatPercentage (float percentage, int digits) |
| Format percentage. | |
| String | formatSize (float size) |
| Format size. | |
| String | formatSize (float size, int digits) |
| Format size. | |
| String | formatTimeDifference (float seconds) |
| Time difference. | |
| FormattingHelper | new () |
| Create FormattingHelper instance. | |
Provides common text formatting support for UI.
| String Dragengine.Utils.FormattingHelper.formatCount | ( | float | count | ) |
Format count.
Returns text in the form "1.2T", "1.2G", "1.2M", "1.2K" or just "12".
References formatCount().
Referenced by formatCount(), and formatCount().
| String Dragengine.Utils.FormattingHelper.formatCount | ( | float | count, |
| int | digits ) |
Format count with custom digit count.
Same as formatCount(float) but with the choice of digits clamped to the range from 0 to 3.
References formatCount().
| String Dragengine.Utils.FormattingHelper.formatPercentage | ( | float | percentage | ) |
| String Dragengine.Utils.FormattingHelper.formatPercentage | ( | float | percentage, |
| int | digits ) |
Format percentage.
Same as #formatPercentags(float) but with the choice of digits clamped to the range from 0 to 3.
References formatSize().
| String Dragengine.Utils.FormattingHelper.formatSize | ( | float | size | ) |
Format size.
Returns text in the form "1.2TB", "1.2GB", "1.2MB", "1.2Kk" or just "12b". Uses 1024 as divisor instead of 1000.
Referenced by formatPercentage(), and formatTimeDifference().
| String Dragengine.Utils.FormattingHelper.formatSize | ( | float | size, |
| int | digits ) |
Format size.
Same as formatSize(float) but with the choice of digits clamped to the range from 0 to 3.
| String Dragengine.Utils.FormattingHelper.formatTimeDifference | ( | float | seconds | ) |
Time difference.
Returns text in the form "1d", "1h", "1min", "1s". For use with TimeDate#secondsSince(TimeDate) or remaining time calculations.
References formatPercentage(), formatSize(), and formatTimeDifference().
Referenced by formatTimeDifference().
| FormattingHelper Dragengine.Utils.FormattingHelper.new | ( | ) |