Anonymous

Module:MoneyMakingGuide: Difference between revisions

From Melvor Idle
m
Turn profit into zero when the value is omitted
m (Reformat total profit layout)
m (Turn profit into zero when the value is omitted)
Line 89: Line 89:


local function parseProfitMargin(minProfit, maxProfit)
local function parseProfitMargin(minProfit, maxProfit)
-- Manually set maxProfit to numeric 0, only if it's nil.
if maxProfit == nil then maxProfit = 0 end
local min = tonumber(minProfit)
local min = tonumber(minProfit)
local max = tonumber(maxProfit)
local max = tonumber(maxProfit)
if min == nil then
if max == nil then
error("maxProfit is not a valid number.")  
error("maxProfit is not a valid number.")  
end
end
2,874

edits