Documentation for this module may be created at Module:Int/doc
local p = {}
function p.main(frame)
local input = frame.args[1] or ''
-- Strip wiki formatting
input = mw.ustring.gsub(input, "'''''", "") -- bold+italic
input = mw.ustring.gsub(input, "'''", "") -- bold
input = mw.ustring.gsub(input, "''", "") -- italic
-- Attempt to parse as number
local num = tonumber(input)
if num then
return math.floor(num + 0.5)
else
return 0 -- default fallback
end
end
return p