2,875
edits
m (Don't show days if daycount = 0) |
m (Make resulting table vertical instead of horizontal) |
||
Line 10: | Line 10: | ||
local days = math.floor(timeInHundredths / (3600000 * 24)) | local days = math.floor(timeInHundredths / (3600000 * 24)) | ||
if days == 0 then | if days == 0 then | ||
return string.format("%02dh %02dm %02ds", hrs % 24, min % 60, sec % 60) | |||
else | |||
return string.format("%d days %02dh %02dm %02ds", days, hrs % 24, min % 60, sec % 60) | |||
end | end | ||
end | |||
function p._addTableRow(tbl, c1, c2) | |||
tbl:tag("tr") | |||
:tag("th"):wikitext(c1) | |||
:tag("td"):wikitext(c2) | |||
return tbl | |||
end | end | ||
Line 31: | Line 38: | ||
:addClass("wikitable sticky-header text-align-right align-left-1") | :addClass("wikitable sticky-header text-align-right align-left-1") | ||
p._addTableRow(tbl, "Current Experience", shared.formatnum(currentExp)) | |||
p._addTableRow(tbl, "Target Level", targetLvl) | |||
p._addTableRow(tbl, "Target Experience", shared.formatnum(targetExp)) | |||
p._addTableRow(tbl, "Experience Remaining", shared.formatnum(expRemaining)) | |||
p._addTableRow(tbl, "Actions Left", shared.formatnum(actionsToTarget)) | |||
p._addTableRow(tbl, "Time Left", p._formatTime(timeToTarget)) | |||
return tostring(tbl) | return tostring(tbl) |
edits