Module:Workshop cost

-- --This script should calculate the cost of producing 10,000 components --for the production of an item.

--Generate backing array local p = {};

-- Main function function p.Upgrade(frame) data = frame:getParent.args; --Get costs local cost_1day = formatnum(data["cost-1-day"]); local cost_3day = formatnum(data["cost-3-day"]); --Get production amounts local comp_1day = formatnum(data["comp-1-day"]); local comp_3day = formatnum(data["comp-3-day"]); --Do math for 1 day --Do math for 3 day --compare results --Return lower result and optimum production method This part needs to be designed for wiki-presentable output return out; end

---Support_Functions --Function for converting strings to numbers function formatnum(str) return tonumber(string.gsub(str,",",""),10); end

--Required to get any return from the script. return p;