Module:Sandbox/Aurelain/HeroClassSkills
From Heroes of Might and Magic: Olden Era Official Wiki
Documentation for this module may be created at Module:Sandbox/Aurelain/HeroClassSkills/doc
-- This module is intended as a supporting muscle for the HeroClassSkills template.
local p = {}
-- Displays a variable
------------------------------------------------------------------------------------------------------------------------
local function dump(target)
return '<pre>' .. mw.dumpObject(target) .. '</pre>'
end
------------------------------------------------------------------------------------------------------------------------
function p.populate(frame)
local lang = frame.args.lang
local id = frame.args.id;
local total = 1000;
local cleanTitle = frame:getTitle().gsub('Module:', '')
return frame:preprocess(mw.ustring.format([[
{{%s/base
| lang = %s
| id = %s
| total = %s
}}
]], cleanTitle, lang, id, total))
end
------------------------------------------------------------------------------------------------------------------------
function p.percent(frame)
local a = frame.args[1]
local b = frame.args[2]
return string.format("%.2f", 100 * a / b)
end
return p


