2,875
edits
m (Use local functions) |
m (Replace Shared module with Number module) |
||
Line 2: | Line 2: | ||
local MEXP = require('Module:Experience') | local MEXP = require('Module:Experience') | ||
local | local number = require('Module:Number') | ||
local function formatTime(timeInHundredths) | local function formatTime(timeInHundredths) | ||
Line 38: | Line 38: | ||
:addClass("wikitable sticky-header text-align-right align-left-1") | :addClass("wikitable sticky-header text-align-right align-left-1") | ||
addTableRow(tbl, "Current Experience", | addTableRow(tbl, "Current Experience", number.formatnum(currentExp)) | ||
addTableRow(tbl, "Target Level", targetLvl) | addTableRow(tbl, "Target Level", targetLvl) | ||
addTableRow(tbl, "Target Experience", | addTableRow(tbl, "Target Experience", number.formatnum(targetExp)) | ||
addTableRow(tbl, "Experience Remaining", | addTableRow(tbl, "Experience Remaining", number.formatnum(expRemaining)) | ||
addTableRow(tbl, "Actions Left", | addTableRow(tbl, "Actions Left", number.formatnum(actionsToTarget)) | ||
addTableRow(tbl, "Time Left", formatTime(timeToTarget)) | addTableRow(tbl, "Time Left", formatTime(timeToTarget)) | ||
Line 55: | Line 55: | ||
local args = frame:getParent().args | local args = frame:getParent().args | ||
local currentExp = | local currentExp = number.toNumberOrDefault(args.currentExp, 0) | ||
local currentLvl = | local currentLvl = number.toNumberOrDefault(args.currentLvl, 0) | ||
local targetLvl = | local targetLvl = number.toNumberOrError(args.targetLvl) | ||
local actionExp = | local actionExp = number.toNumberOrError(args.actionExp) | ||
local actionTime = | local actionTime = number.toNumberOrError(args.actionTime) | ||
-- Check Exp param for validity first, then Lvl | -- Check Exp param for validity first, then Lvl |
edits