Module:MoneyMakingGuide: Difference between revisions

Add rounding to outputs
m (Fix item icons?)
(Add rounding to outputs)
Line 175: Line 175:
qtyCell:node(getErrorDiv("Unable to parse quantity for item: " .. i.name))
qtyCell:node(getErrorDiv("Unable to parse quantity for item: " .. i.name))
else
else
qtyCell:wikitext(i.amount)
qtyCell:wikitext(num.round2(i.amount))
end
end
qtyCell:done()
qtyCell:done()
Line 184: Line 184:
else
else
local tot = i.value * (i.amount or 0)
local tot = i.value * (i.amount or 0)
valCell:wikitext(icons.GP(tot))
valCell:wikitext(icons.GP(num.round2(tot)))
end
end
valCell:done()
valCell:done()
Line 209: Line 209:
end
end
local skillIcon = getSkillExpIcon(skillLine.name, skillLine.exp or 0)
local skillExp = num.round2(skillLine.exp or 0)
local skillIcon = getSkillExpIcon(skillLine.name, skillExp)


if hasInvalidExp then
if hasInvalidExp then
Line 279: Line 280:
         :tag("td")
         :tag("td")
         if args['profit'] then
         if args['profit'] then
         html:wikitext(icons.GP(args['profit']))
         html:wikitext(icons.GP(num.round2(args['profit'])))
         else
         else
         html:wikitext(icons.GP(pOutputs.TotalValue - pInputs.TotalValue))
         html:wikitext(icons.GP(num.round2(pOutputs.TotalValue - pInputs.TotalValue)))
         end
         end
         html = html
         html = html
Line 298: Line 299:
             :wikitext("Inputs")
             :wikitext("Inputs")
             if pInputs.TotalValue ~= 0 then
             if pInputs.TotalValue ~= 0 then
             html:wikitext(" (" .. icons.GP(pInputs.TotalValue) .. ")")
             html:wikitext(" (" .. icons.GP(num.round2(pInputs.TotalValue)) .. ")")
             end
             end
             html = html
             html = html
Line 304: Line 305:
             :wikitext("Outputs")
             :wikitext("Outputs")
             if pOutputs.TotalValue ~= 0 then
             if pOutputs.TotalValue ~= 0 then
             html:wikitext(" (" .. icons.GP(pOutputs.TotalValue) .. ")")
             html:wikitext(" (" .. icons.GP(num.round2(pOutputs.TotalValue)) .. ")")
             end
             end
             html = html
             html = html
2,875

edits