Module:Experience/Album: Difference between revisions
Support "raw" parameter
(Created page with "require('strict') local data = mw.loadData('Module:Experience/data').album local lang = mw.language.getContentLanguage() local p = {} -- Given a level, returns the album XP (if known). -- If not known, returns the given "default" argument function p.main(frame) local args = frame:getParent().args if args[1] == nil then error('{{Album XP}} transcluded without level') end local level = tonumber(args[1]) local xp = p._main(level) if xp ~= nil then return tostrin...") |
(Support "raw" parameter) |
||
Line 12:
error('{{Album XP}} transcluded without level')
end
local raw = (args[2] or ''):lower() == 'raw'
local level = tonumber(args[1])
local xp = p._main(level)
if xp ~= nil then
if raw then
return tostring(xp)
end
return lang:formatNum(xp)
end
return args.default or ''
|