Module:WeightToPercent
Documentation for this module may be created at Module:WeightToPercent/doc
local p = {}
function p.convert(frame)
local weight = frame.args['weight']
local totalweight = frame.args['total']
if weight == nil then return "ERROR: weight input (1rst arg) is nil"
elseif totalweight == nil then return "ERROR: totalweight (2nd arg) input is nil"
elseif weight == 0 then return 0
end
return 100 * totalweight / weight
end
return p