Module:Icons: Difference between revisions

_Currency: Allow passing of nil amount to return currency icon only
(Add biome link overrides)
(_Currency: Allow passing of nil amount to return currency icon only)
Line 580: Line 580:


function p._Currency(fileName, link, altText, amt, maxAmt)
function p._Currency(fileName, link, altText, amt, maxAmt)
local amtText = formatnum(amt)
local amtText = nil
if maxAmt ~= nil and maxAmt >= amt then
if tonumber(amt) ~= nil then
amtText = amtText .. ' - ' .. formatnum(maxAmt)
amtText = formatnum(amt)
if maxAmt ~= nil and maxAmt >= amt then
amtText = amtText .. ' - ' .. formatnum(maxAmt)
end
end
end


Line 591: Line 594:
fileText = fileText .. '|link=' .. link
fileText = fileText .. '|link=' .. link
end
end
fileText = fileText .. '|alt=' .. ((altText == nil and '') or altText) .. ']] '
fileText = fileText .. '|alt=' .. ((altText == nil and '') or altText) .. ']]'
end
end


return '<span style="display:inline-block">' .. fileText .. amtText .. '</span>'
return '<span style="display:inline-block">' .. fileText .. (amtText ~= nil and '&nbsp;' .. amtText or '') .. '</span>'
end
end