17,101
edits
(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 tonumber(amt) ~= nil then | |||
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 ' ' .. amtText or '') .. '</span>' | ||
end | end | ||