Module:ProfessionList: Difference between revisions

m
fix edge cases with sell price arithmetic
m (incorporate quantity of product item in the returned sellPrice variable)
m (fix edge cases with sell price arithmetic)
Line 154:
-- include the price of selling the product
item.sellPricelocal sell = search.getShopSellPrice(item.product) * (item.output[1].quantity or 0)
local qty = item.output[1].quantity
item.sellPrice = sell and qty and sell * qty
item.profit = item.buyPrice and item.sellPrice and item.sellPrice - item.buyPrice
item.profitPerXP = item.profit and item.xp and item.profit / item.xp
11,349

edits