Module:PriceCalculator: Difference between revisions

No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 54: Line 54:
end
end


local coinIcon = '[[File:Coins.png|22px|link=Coins]]'
local coinIcon = frame:preprocess('{{CoinIcon|size=16px}}')


if max and max ~= min then
if max and max ~= min then
if price > 1 then
if price > 1 then
return string.format('<abbr title="%d coins each">%s–%s</abbr>%s', price, format(price * min), format(price * max), coinIcon)
return string.format('<abbr title="%d coins each">%s–%s</abbr> %s', price, format(price * min), format(price * max), coinIcon)
else
else
return string.format('%s–%s%s', format(price * min), format(price * max), coinIcon)
return string.format('%s–%s %s', format(price * min), format(price * max), coinIcon)
end
end
elseif min == 1 then
elseif min == 1 then
return string.format('%s%s', format(price), coinIcon)
return string.format('%s %s', format(price), coinIcon)
else
else
if price > 1 then
if price > 1 then
return string.format('<abbr title="%d coins each">%s</abbr>%s', price, format(price * min), coinIcon)
return string.format('<abbr title="%d coins each">%s</abbr> %s', price, format(price * min), coinIcon)
else
else
return string.format('%s%s', format(price * min), coinIcon)
return string.format('%s %s', format(price * min), coinIcon)
end
end
end
end