View source for Module:Shop calculator
Jump to navigation
Jump to search
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
local p = {}
local paramTest = require('Module:Paramtest')
local yesNo = require('Module:Yesno')
function truncate(num)
local whole, decimal = math.modf(num + 0.000001) -- addition is to prevent floating point rounding issues
return whole
end
function sell(basePrice, shopBuysAt, delta, baseStock, currentStock, quantitySold, itemValue)
local total = 0
local upperBound = truncate(itemValue + (shopBuysAt * itemValue)) -- Item value + base price shop buys at
local lowerBound = truncate(itemValue * .1)
local function understockSellPrice(stockDelta)
return truncate(itemValue * (shopBuysAt + (delta * stockDelta)))
end
000
1:0
Template used on this page:
Return to Module:Shop calculator.