Arma Reforger Script API
Loading...
Searching...
No Matches
Static Public Member Functions | Static Protected Member Functions | List of all members
SCR_FormatHelper Interface Reference

Static Public Member Functions

static string FloatToStringNoZeroDecimalEndings (float value, int lenDec)
 Returns a float with set decimal lenght that will remove any ending zeroes in the decimal values.
 
static string FormatDateTime (int year, int month, int day, int hour, int minute, int second)
 
static string FormatDate (int year, int month, int day)
 
static string FormatTime (int totalSeconds)
 
static string FormatTime (int hour, int minute, int second)
 
static string GetTimeFormatting (int days, int hours, int minutes, int seconds, ETimeFormatParam hideEmpty=0, ETimeFormatParam hideLeadingZeroes=0)
 Depending on the flags given it will return a variation on dd:hh:mm:ss and d:h:m:s.
 
static string GetTimeFormatting (int totalSeconds, ETimeFormatParam hideEmpty=0, ETimeFormatParam hideLeadingZeroes=0)
 Combines GetTimeFormatting() and SCR_DateTimeHelper.GetDayHourMinuteSecondFromSeconds() It is possible to hide a time varriable like days using the hide bool when it is 0 or less Usage: SCR_FormatHelper.GetTimeFormatting(totalSeconds, ETimeFormatParam.DAYS | ETimeFormatParam.HOURS, ETimeFormatParam.MINUTES).
 
static string GetTimeFormattingHideSeconds (int totalSeconds, ETimeFormatParam hideEmpty=0, ETimeFormatParam hideLeadingZeroes=0)
 Combines GetTimeFormatting() and SCR_DateTimeHelper.GetDayHourMinuteSecondFromSeconds() while hiding seconds It is possible to hide a time varriable like days using the hide bool when it is 0 or less Usage: SCR_FormatHelper.GetTimeFormatting(totalSeconds, ETimeFormatParam.DAYS | ETimeFormatParam.HOURS, ETimeFormatParam.MINUTES).
 
static string GetTimeFormattingHoursMinutes (int hours, int minutes, ETimeFormatParam hideEmpty=0, ETimeFormatParam hideLeadingZeroes=0)
 Returns a variant of hh:mm and h:m.
 
static string GetTimeFormattingMinutesSeconds (int minutes, int seconds, ETimeFormatParam hideEmpty=0, ETimeFormatParam hideLeadingZeroes=0)
 Returns a variant of mm:ss and m:s.
 
static string GetTimeSinceEventImprecise (int timeDiffSeconds)
 Returns text of how much time has passed since event: "23 days ago", or "23 hours ago", or "23 minutes ago".
 
static string FormatFrequencies (notnull set< int > frequencies, set< int > highlightFrequencies=null)
 Format the list of frequencies as single-line text.
 

Static Protected Member Functions

static string ReturnTimeTypeString (int prevTimeTypeAmount, int currentTimeTypeAmount, int numberLength)
 Returns proper formatting of TimeType Always have number length 1 then check if ETimeFormatParam (for example) SECONDS is given is true (aka 1) or not (aka 0)
 
static string GetTimeSinceEventString (int amount, string oneUnit, string manyUnits)
 Helps with time formatting - returns "0 minutes", "3 minutes", but "1 minute".
 

Member Function Documentation

◆ FloatToStringNoZeroDecimalEndings()

static string SCR_FormatHelper.FloatToStringNoZeroDecimalEndings ( float  value,
int  lenDec 
)
static

Returns a float with set decimal lenght that will remove any ending zeroes in the decimal values.

Parameters
valueThe float value to get the string from
lenDecLenght of decimals to show. Zeroes of course are not counted return Converted float into a string with decimals without ending zeroes
float value = "1337.2305";
>> 1337
>> 1337.2
>> 1337.23
>> 1337.23
>> 1337.2305
Definition: SCR_FormatHelper.c:2
static string FloatToStringNoZeroDecimalEndings(float value, int lenDec)
Returns a float with set decimal lenght that will remove any ending zeroes in the decimal values.
Definition: SCR_FormatHelper.c:26

◆ FormatDate()

static string SCR_FormatHelper.FormatDate ( int  year,
int  month,
int  day 
)
static
Parameters
yearcan be < 100, if so 2000 will be added (86 = 2086, NOT 1986)
Returns
date in format "yyyy-mm-dd"

◆ FormatDateTime()

static string SCR_FormatHelper.FormatDateTime ( int  year,
int  month,
int  day,
int  hour,
int  minute,
int  second 
)
static
Returns
datetime in format "yyyy-mm-dd hh:ii:ss"

◆ FormatFrequencies()

static string SCR_FormatHelper.FormatFrequencies ( notnull set< int >  frequencies,
set< int >  highlightFrequencies = null 
)
static

Format the list of frequencies as single-line text.

Parameters
frequenciesList of frequencies
Returns
Text with frequencies

◆ FormatTime() [1/2]

static string SCR_FormatHelper.FormatTime ( int  hour,
int  minute,
int  second 
)
static
Returns
time in format "hh:ii:ss"

◆ FormatTime() [2/2]

static string SCR_FormatHelper.FormatTime ( int  totalSeconds)
static
Returns
time in format "hh:ii:ss"

◆ GetTimeFormatting() [1/2]

static string SCR_FormatHelper.GetTimeFormatting ( int  days,
int  hours,
int  minutes,
int  seconds,
ETimeFormatParam  hideEmpty = 0,
ETimeFormatParam  hideLeadingZeroes = 0 
)
static

Depending on the flags given it will return a variation on dd:hh:mm:ss and d:h:m:s.

Time variables that are -1 will always be hidden (So without days it would look: hh:mm:ss) Usage: SCR_FormatHelper.GetTimeFormatting(0, 13, 37, 0, ETimeFormatParam.DAYS | ETimeFormatParam.HOURS, ETimeFormatParam.MINUTES). Hide Days and Hours if 0, Never show leading 0 for minutes

Parameters
daysInt amount of days
hoursInt amount of hours
minutesInt amount of minutes
secondsInt amount of seconds
hideEmptyflag time that needs to be hidden if zero (Example: ETimeFormatParam.DAYS hides days if 0 or less)
hideLeadingZeroesflag that hides leading zero for Hours, Minutes and Seconds (Example: ETimeFormatParam.HOURS displays h:mm:ss instead of hh:mm:ss)
Returns
string Time ordered in days, hours, minutes and seconds (dd:hh:mm:ss)

◆ GetTimeFormatting() [2/2]

static string SCR_FormatHelper.GetTimeFormatting ( int  totalSeconds,
ETimeFormatParam  hideEmpty = 0,
ETimeFormatParam  hideLeadingZeroes = 0 
)
static

Combines GetTimeFormatting() and SCR_DateTimeHelper.GetDayHourMinuteSecondFromSeconds() It is possible to hide a time varriable like days using the hide bool when it is 0 or less Usage: SCR_FormatHelper.GetTimeFormatting(totalSeconds, ETimeFormatParam.DAYS | ETimeFormatParam.HOURS, ETimeFormatParam.MINUTES).

Hide Days and Hours if 0, Never show leading 0 for minutes

Parameters
totalSecondsInt total amount of seconds to be converted to dd:hh:mm:ss
hideEmptyflag time that needs to be hidden if zero (Example: ETimeFormatParam.DAYS hides days if 0 or less)
hideLeadingZeroesflag that hides leading zero for Hours, Minutes and Seconds (Example: ETimeFormatParam.HOURS displays h:mm:ss instead of hh:mm:ss)
Returns
string Time ordered in days, hours, minutes and seconds (dd:hh:mm:ss)

◆ GetTimeFormattingHideSeconds()

static string SCR_FormatHelper.GetTimeFormattingHideSeconds ( int  totalSeconds,
ETimeFormatParam  hideEmpty = 0,
ETimeFormatParam  hideLeadingZeroes = 0 
)
static

Combines GetTimeFormatting() and SCR_DateTimeHelper.GetDayHourMinuteSecondFromSeconds() while hiding seconds It is possible to hide a time varriable like days using the hide bool when it is 0 or less Usage: SCR_FormatHelper.GetTimeFormatting(totalSeconds, ETimeFormatParam.DAYS | ETimeFormatParam.HOURS, ETimeFormatParam.MINUTES).

Hide Days and Hours if 0, Never show leading 0 for minutes

Parameters
totalSecondsInt total amount of seconds to be converted to dd:hh:mm
hideEmptyflag time that needs to be hidden if zero (Example: ETimeFormatParam.DAYS hides days if 0 or less)
hideLeadingZeroesflag that hides leading zero for Hours, Minutes and Seconds (Example: ETimeFormatParam.HOURS displays h:mm instead of hh:mm)
Returns
string Time ordered in days, hours and minutes (dd:hh:mm)

◆ GetTimeFormattingHoursMinutes()

static string SCR_FormatHelper.GetTimeFormattingHoursMinutes ( int  hours,
int  minutes,
ETimeFormatParam  hideEmpty = 0,
ETimeFormatParam  hideLeadingZeroes = 0 
)
static

Returns a variant of hh:mm and h:m.

Parameters
hoursInt amount of hours
minutesInt amount of minutes
hideEmptyflag time that needs to be hidden if zero (Example: ETimeFormatParam.HOURS hides hours if 0 or less)
hideLeadingZeroesflag that hides leading zero (Example: ETimeFormatParam.HOURS displays h:mm instead of hh:mm)
Returns
string Time ordered in hours and minutes (hh:mm)

◆ GetTimeFormattingMinutesSeconds()

static string SCR_FormatHelper.GetTimeFormattingMinutesSeconds ( int  minutes,
int  seconds,
ETimeFormatParam  hideEmpty = 0,
ETimeFormatParam  hideLeadingZeroes = 0 
)
static

Returns a variant of mm:ss and m:s.

Parameters
minutesInt amount of minutes
secondsInt amount of seconds
hideEmptyflag time that needs to be hidden if zero (Example: ETimeFormatParam.MINUTES hides minutes if 0 or less)
hideLeadingZeroesflag that hides leading zero (Example: ETimeFormatParam.MINUTES displays m:ss instead of mm:ss)
Returns
string Time ordered in minutes and hours (mm:ss)

◆ GetTimeSinceEventImprecise()

static string SCR_FormatHelper.GetTimeSinceEventImprecise ( int  timeDiffSeconds)
static

Returns text of how much time has passed since event: "23 days ago", or "23 hours ago", or "23 minutes ago".

When timeDiffSeconds is below 60, it returns "0 minutes ago".

◆ GetTimeSinceEventString()

static string SCR_FormatHelper.GetTimeSinceEventString ( int  amount,
string  oneUnit,
string  manyUnits 
)
staticprotected

Helps with time formatting - returns "0 minutes", "3 minutes", but "1 minute".

◆ ReturnTimeTypeString()

static string SCR_FormatHelper.ReturnTimeTypeString ( int  prevTimeTypeAmount,
int  currentTimeTypeAmount,
int  numberLength 
)
staticprotected

Returns proper formatting of TimeType Always have number length 1 then check if ETimeFormatParam (for example) SECONDS is given is true (aka 1) or not (aka 0)

Parameters
numberLengthchecks if should have leading zero

The documentation for this interface was generated from the following file: