Math & Operations

Usage Script
round down ${Math.floor(yourvariable)}
Round to the nearest Integer ${Math.round(yourvariable [, decimals])
Force variable to be read as a number ${parseInt(yourvariable)}
Translate (date) milliseconds to days ${Math.floor((tempVars("uptime-ms") % 31536000) / 86400)}
Translate (date) milliseconds to hours (up to 24) ${Math.floor((tempVars("uptime-ms") % 86400) / 3600)}
Translate (date) milliseconds to minutes (up to 60) ${Math.floor((tempVars("uptime-ms") % 3600) / 60)}
Translate (date) milliseconds to seconds (up to 60) ${Math.round(tempVars("uptime-ms") % 60)}
Translate (duration) milliseconds to a human readable format var duration = tempVars("time_var");
var ms = parseInt((duration%1000)/100);
var s = parseInt((duration/1000)%60);
var m = parseInt((duration/(1000*60))%60);
var h = parseInt((duration/(1000*60*60))%24);
var timeoutput = h + "h:" + m + "m:" + s + "s:" + ms + "ms";

results matching ""

    No results matching ""