Drag[en]gine Script Module DragonScript
1.23
|
Provides common text formatting support for UI. More...
Public Member Functions | |
String | formatCount (float count) |
Format count. More... | |
String | formatCount (float count, int digits) |
Format count with custom digit count. More... | |
String | formatPercentage (float percentage) |
Format percentage. More... | |
String | formatPercentage (float percentage, int digits) |
Format percentage. More... | |
String | formatSize (float size) |
Format size. More... | |
String | formatSize (float size, int digits) |
Format size. More... | |
String | formatTimeDifference (float seconds) |
Time difference. More... | |
FormattingHelper | new () |
Create FormattingHelper instance. More... | |
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".
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.
String Dragengine.Utils.FormattingHelper.formatPercentage | ( | float | percentage | ) |
Format percentage.
Returns text in the form "12.3%".
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.
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.
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.
FormattingHelper Dragengine.Utils.FormattingHelper.new | ( | ) |
Create FormattingHelper instance.