Anonymous

Module:MoneyMakingGuide: Difference between revisions

From Melvor Idle
Fix currency function calls
m (Turn profit into zero when the value is omitted)
(Fix currency function calls)
 
Line 27: Line 27:


local SpecialIcons = {
local SpecialIcons = {
['Gold Pieces'] = icons.GP(),
['Gold Pieces'] = icons._Currency('melvorD:GP'),
['Slayer Coins'] = icons.SC(),
['Slayer Coins'] = icons._Currency('melvorD:SlayerCoins'),
}
}


Line 101: Line 101:
if min then
if min then
sb  :append(icons.GP(num.round2(min)))
sb  :append(icons._Currency('melvorD:GP', num.round2(min)))
:append(' to ')
:append(' to ')
end
end
sb  :append(icons.GP(num.round2(max)))
sb  :append(icons._Currency('melvorD:GP', num.round2(max)))
:append(' per hour')
:append(' per hour')
Line 240: Line 240:
valCell
valCell
:css('text-align','right')
:css('text-align','right')
:wikitext(icons.GP(num.round2(tot)))
:wikitext(icons._Currency('melvorD:GP', num.round2(tot)))
:attr("data-sort-value", tot)
:attr("data-sort-value", tot)
end
end
Line 356: Line 356:
         :tag("td")
         :tag("td")
         if args['profit'] then
         if args['profit'] then
         html:wikitext(icons.GP(num.round2(args['profit'])))
         html:wikitext(icons._Currency('melvorD:GP', num.round2(args['profit'])))
         else
         else
         html:wikitext(icons.GP(num.round2(maxProfit)))
         html:wikitext(icons._Currency('melvorD:GP', num.round2(maxProfit)))
         end
         end
         html = html
         html = html
Line 375: Line 375:
             :wikitext("Inputs")
             :wikitext("Inputs")
             if pInputs.TotalValue ~= 0 then
             if pInputs.TotalValue ~= 0 then
             html:wikitext(" (" .. icons.GP(num.round2(pInputs.TotalValue)) .. ")")
             html:wikitext(" (" .. icons._Currency('melvorD:GP', num.round2(pInputs.TotalValue)) .. ")")
             end
             end
             html = html
             html = html
Line 381: Line 381:
             :wikitext("Outputs")
             :wikitext("Outputs")
             if pOutputs.TotalValue ~= 0 then
             if pOutputs.TotalValue ~= 0 then
             html:wikitext(" (" .. icons.GP(num.round2(pOutputs.TotalValue)) .. ")")
             html:wikitext(" (" .. icons._Currency('melvorD:GP', num.round2(pOutputs.TotalValue)) .. ")")
             end
             end
             html = html
             html = html