Module:Dice/Format: Difference between revisions
m
Add a 'multiplier' field to Dice/Format
(oops should have left that name alone) |
imported>Ontoclasm m (Add a 'multiplier' field to Dice/Format) |
||
Line 10: | Line 10: | ||
end | end | ||
local template_title = (frame.args.template ~= nil and frame.args.template ~= '') and frame.args.template or 'Dice string' | |||
local mult = (frame.args.multiplier ~= nil and frame.args.multiplier ~= '') and frame.args.mult or 1 | |||
local average = dice:average() * mult | |||
local average = dice:average() | |||
local average_truncated = ('%d'):format(average) | local average_truncated = ('%d'):format(average) | ||
local maximum = dice:maximum() | local maximum = dice:maximum() * mult | ||
local minimum = dice:minimum() | local minimum = dice:minimum() * mult | ||
local range = dice:range() | local range = dice:range() * mult | ||
local variance = dice:variance() | local variance = dice:variance() * mult | ||
return frame:expandTemplate{ | return frame:expandTemplate{ |