Module:NPCPriceSpread

local getArgs = require('Module:Arguments').getArgs

local p = {} local table = require('Module:Table') local string = require('Module:String') local yesno = require('Module:Yesno')

function p.main(frame) args = getArgs(frame) return mw.getCurrentFrame:preprocess(p.writeText(args)) end

function p.writeText(args) local coins = args["coins"] or args[1] or 0 local list = args["list"] or args[2] local ending = args["ending"] or args[3] or 'possible' local code = yesno(args["code"]) or yesno(args[4]) local text = {} local values = {coins * 0.97, coins * 0.98, coins * 0.99, coins, coins * 1.07, coins * 1.08, coins * 1.09, coins * 1.1} if not code then if not list then table.push(text, table.concat{				',, and  ', ending			}) else return values[list+1]..' ' end else table.push(text, table.concat(values, ', ')) end return table.concat(text) end

function p.foo(v) return yesno(v) end

return p