Module:PriceCalculator: Difference between revisions

No edit summary
No edit summary
Line 58: Line 58:
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