Module:EnchantmentBazaarStats

-- local getArgs = require("Module:Arguments").getArgs local string = require("Module:String")

local p = {}

function p.bazaarStats(frame) local args = getArgs(frame) local id = args.id:gsub("[Ee][Nn][Cc][Hh][Aa][Nn][Tt][Mm][Ee][Nn][Tt]_", ""):upper local name = args.name or id:lower local minimum = string._toArabic(args.minimum or args.min) local maximum = string._toArabic(args.maximum or args.max) return mw.getCurrentFrame:preprocess(p._bazaarStats(id, name, minimum, maximum, true)) end

function p._bazaarStats(id, name, minimum, maximum, makeTable) local rows = {} for i = minimum, maximum, 1 do		table.insert(rows, "|-") if i == minimum then table.insert(rows, :format(maximum - minimum + 1, name)) end table.insert(rows, ([[| data-sort-value="%d" | %s		| 	end	rows = table.concat(rows, "\n")	if makeTable then		return ([[{| class="wikitable ct sortable" ! rowspan="2" | Enchantment ! rowspan="2" | Tier ! colspan="2" | Buy ! colspan="2" | Sell ! rowspan="2" | Price Spread ! colspan="2" | Price Change ! data-sort-type="number" | Item ! data-sort-type="number" | Stack ! data-sort-type="number" | Item ! data-sort-type="number" | Stack ! Buy ! Sell %s	end	return rows end
 * ]]):format(i, string._toRoman(i), id, i, id, i, id, i, id, i, id, i, id, i, id, i))
 * ]]):format(i, string._toRoman(i), id, i, id, i, id, i, id, i, id, i, id, i, id, i))
 * ]]):format(i, string._toRoman(i), id, i, id, i, id, i, id, i, id, i, id, i, id, i))
 * ]]):format(i, string._toRoman(i), id, i, id, i, id, i, id, i, id, i, id, i, id, i))
 * ]]):format(i, string._toRoman(i), id, i, id, i, id, i, id, i, id, i, id, i, id, i))
 * ]]):format(i, string._toRoman(i), id, i, id, i, id, i, id, i, id, i, id, i, id, i))
 * }]]):format(rows)

return p