# Format Duration
Grammar — Format Duration(duration)
Flags —Native
|Function
Formats a duration in seconds into a localization friendly text value. For example, 150 will become 2:30 in English
# Arguments
int
— Duration
Returns — text
native text FormatDuration(int seconds);
# Related
Category: Conversion / Basic Conversions
- Convert String To Text —
text
— StringToText - Convert Game Link To String
- Convert String To Game Link
- Convert String To Catalog Entry
- Convert String To Catalog Reference
- Convert String To Catalog Field Name
- Convert String To Catalog Field Path
- Convert String To Catalog Scope
- Convert Catalog Entry To String
- Convert Catalog Reference To String
- Convert Catalog Reference (Any -> Numeric)
- Convert Catalog Reference (Any -> Upgrade)
- Convert Catalog Reference (Upgrade -> Any)
- Convert Catalog Reference (Numeric -> Any)
- Convert Catalog Field Name To String
- Convert Catalog Field Path To String
- Convert Catalog Scope To String
- Convert String To Image File
- Convert String To Movie File
- Convert String To Cutscene File
- Convert Conversation State Index To String
- Convert String To Conversation State Index
- Convert User Data Instance To String
- Convert String To User Data Instance
- Convert String To Real —
fixed
— StringToFixed - Convert String To Integer —
int
— StringToInt - Convert String To Ability Command —
abilcmd
— StringToAbilCmd - Convert Real To Text —
text
— FixedToText - Convert Real To Text (Advanced) —
text
— FixedToTextAdvanced - Convert Real To String —
string
— FixedToString - Convert Real To Integer —
int
— FixedToInt - Convert Integer To Text —
text
— IntToText - Convert Integer To String —
string
— IntToString - Convert Integer To Real —
fixed
— IntToFixed - Convert Boolean To Text —
text
— libNtve_gf_ConvertBooleanToText - Convert Boolean To Integer —
int
— BoolToInt - Convert Boolean To String —
string
— libNtve_gf_ConvertBooleanToString - Convert String To Boolean —
bool
— libNtve_gf_ConvertStringToBoolean - Convert Point To String —
string
— libNtve_gf_ConvertPointToString - Convert String To Point —
point
— libNtve_gf_ConvertStringToPoint - Convert Image To String
- Convert Game User To Integer
- Format Number —
text
— FormatNumber - Format Duration —
text
— FormatDuration
# Examples
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map/MapScript.galaxy:2301
auto52552AD9_val = gv_gasStatus;
if (auto52552AD9_val == ge_PRESET_IsGasOn_GasOff) {
TextExpressionSetToken("Param/Expression/17F482EB", "A", FormatDuration(FixedToInt(gv_gasOff_DURATION)));
lv_label = TextExpressionAssemble("Param/Expression/17F482EB");
lv_width = FixedToInt(gv_gasOff_DURATION);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map/MapScript.galaxy:2307
}
else if (auto52552AD9_val == ge_PRESET_IsGasOn_GasOn) {
TextExpressionSetToken("Param/Expression/D78ED081", "A", FormatDuration(FixedToInt(gv_gasOn_DURATION)));
lv_label = TextExpressionAssemble("Param/Expression/D78ED081");
lv_width = FixedToInt(FixedToInt(gv_gasOn_DURATION));
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map/MapScript.galaxy:2345
autoFE5A62DA_val = gv_gasStatus;
if (autoFE5A62DA_val == ge_PRESET_IsGasOn_GasOff) {
TextExpressionSetToken("Param/Expression/FAF7172C", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer))));
libSwaC_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/FAF7172C"));
libSwaC_gf_SetProgressBarValueRange(0, FixedToInt(gv_gasOff_DURATION));
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map/MapScript.galaxy:2352
else if (autoFE5A62DA_val == ge_PRESET_IsGasOn_GasOn) {
if ((gv_gasOnCycle == 1)) {
TextExpressionSetToken("Param/Expression/DDBBD16D", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer))));
libSwaC_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/DDBBD16D"));
libSwaC_gf_SetProgressBarValueRange(0, 180);
campaigns/swarm.sc2campaign — base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map/MapScript.galaxy:2358
}
else {
TextExpressionSetToken("Param/Expression/0EDC1F0B", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer))));
libSwaC_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/0EDC1F0B"));
libSwaC_gf_SetProgressBarValueRange(0, FixedToInt(gv_gasOn_DURATION));
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map — MapScript.galaxy:2301
auto52552AD9_val = gv_gasStatus;
if (auto52552AD9_val == ge_PRESET_IsGasOn_GasOff) {
TextExpressionSetToken("Param/Expression/17F482EB", "A", FormatDuration(FixedToInt(gv_gasOff_DURATION)));
lv_label = TextExpressionAssemble("Param/Expression/17F482EB");
lv_width = FixedToInt(gv_gasOff_DURATION);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map — MapScript.galaxy:2307
}
else if (auto52552AD9_val == ge_PRESET_IsGasOn_GasOn) {
TextExpressionSetToken("Param/Expression/D78ED081", "A", FormatDuration(FixedToInt(gv_gasOn_DURATION)));
lv_label = TextExpressionAssemble("Param/Expression/D78ED081");
lv_width = FixedToInt(FixedToInt(gv_gasOn_DURATION));
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map — MapScript.galaxy:2345
autoFE5A62DA_val = gv_gasStatus;
if (autoFE5A62DA_val == ge_PRESET_IsGasOn_GasOff) {
TextExpressionSetToken("Param/Expression/FAF7172C", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer))));
libSwaC_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/FAF7172C"));
libSwaC_gf_SetProgressBarValueRange(0, FixedToInt(gv_gasOff_DURATION));
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map — MapScript.galaxy:2352
else if (autoFE5A62DA_val == ge_PRESET_IsGasOn_GasOn) {
if ((gv_gasOnCycle == 1)) {
TextExpressionSetToken("Param/Expression/DDBBD16D", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer))));
libSwaC_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/DDBBD16D"));
libSwaC_gf_SetProgressBarValueRange(0, 180);
campaigns/swarm.sc2campaign/base.sc2maps/maps/campaign/swarm/zhybrid01.sc2map — MapScript.galaxy:2358
}
else {
TextExpressionSetToken("Param/Expression/0EDC1F0B", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_mainTimer))));
libSwaC_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/0EDC1F0B"));
libSwaC_gf_SetProgressBarValueRange(0, FixedToInt(gv_gasOn_DURATION));
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/ptaldarim01.sc2map/MapScript.galaxy:1895
TriggerEnable(TriggerGetCurrent(), false);
lv_title = StringExternal("Param/Value/FB406506");
TextExpressionSetToken("Param/Expression/77903BB8", "A", FormatDuration(FixedToInt(gv_terrazineInactiveDuration)));
lv_label = TextExpressionAssemble("Param/Expression/77903BB8");
lv_maxProgress = FixedToInt(gv_terrazineInactiveDuration);
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/ptaldarim01.sc2map/MapScript.galaxy:1924
while ((libVCMI_gf_GameIsOver() == false)) {
if ((gv_terrazineActive == true)) {
TextExpressionSetToken("Param/Expression/09965B88", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer))));
libVCUI_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/09965B88"));
libVCUI_gf_SetProgressBarValueRange(0, FixedToInt(gv_terrazineActiveDuration));
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/ptaldarim01.sc2map/MapScript.galaxy:1931
else {
if ((gv_terrazineNightCount == 0)) {
TextExpressionSetToken("Param/Expression/F313BE02", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer))));
libVCUI_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/F313BE02"));
libVCUI_gf_SetProgressBarValueRange(0, FixedToInt(gv_terrazineInactiveDuration));
campaigns/void.sc2campaign — base.sc2maps/maps/campaign/void/ptaldarim01.sc2map/MapScript.galaxy:1937
}
else {
TextExpressionSetToken("Param/Expression/A57C104A", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer))));
libVCUI_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/A57C104A"));
libVCUI_gf_SetProgressBarValueRange(0, FixedToInt(gv_terrazineInactiveDuration));
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ptaldarim01.sc2map — MapScript.galaxy:1895
TriggerEnable(TriggerGetCurrent(), false);
lv_title = StringExternal("Param/Value/FB406506");
TextExpressionSetToken("Param/Expression/77903BB8", "A", FormatDuration(FixedToInt(gv_terrazineInactiveDuration)));
lv_label = TextExpressionAssemble("Param/Expression/77903BB8");
lv_maxProgress = FixedToInt(gv_terrazineInactiveDuration);
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ptaldarim01.sc2map — MapScript.galaxy:1924
while ((libVCMI_gf_GameIsOver() == false)) {
if ((gv_terrazineActive == true)) {
TextExpressionSetToken("Param/Expression/09965B88", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer))));
libVCUI_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/09965B88"));
libVCUI_gf_SetProgressBarValueRange(0, FixedToInt(gv_terrazineActiveDuration));
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ptaldarim01.sc2map — MapScript.galaxy:1931
else {
if ((gv_terrazineNightCount == 0)) {
TextExpressionSetToken("Param/Expression/F313BE02", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer))));
libVCUI_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/F313BE02"));
libVCUI_gf_SetProgressBarValueRange(0, FixedToInt(gv_terrazineInactiveDuration));
campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ptaldarim01.sc2map — MapScript.galaxy:1937
}
else {
TextExpressionSetToken("Param/Expression/A57C104A", "A", FormatDuration(FixedToInt(TimerGetRemaining(gv_terrazineTimer))));
libVCUI_gf_SetProgressBarLabel(TextExpressionAssemble("Param/Expression/A57C104A"));
libVCUI_gf_SetProgressBarValueRange(0, FixedToInt(gv_terrazineInactiveDuration));
mods/challenges.sc2mod — base.sc2data/LibChal.galaxy:1804
}
else if (autoA5E8EC1A_val == libChal_ge_ChallengeScoreType_Timeseconds) {
return FormatDuration(lp_score);
}
else {