1,131
edits
No edit summary |
No edit summary |
||
| Line 36: | Line 36: | ||
-- Get parsed smw data | -- Get parsed smw data | ||
local data = p.getData(item, limit) | local data = p.getData(item, limit) | ||
-- Create the header of the output | -- Create the header of the output | ||
| Line 54: | Line 52: | ||
-- Create the rows for the output table | -- Create the rows for the output table | ||
for _, shop in ipairs(data) do | for _, shop in ipairs(data) do | ||
for i, location in ipairs(shop.location) do | for i, location in ipairs(shop.location) do | ||
restbl:tag('tr') | restbl:tag('tr') | ||
| Line 72: | Line 68: | ||
end | end | ||
end | end | ||
return headerText .. tostring(restbl) | return headerText .. tostring(restbl) | ||
| Line 110: | Line 104: | ||
table.sort(smwdata, function(a, b) return b['Store sell price'] < a['Store sell price'] end) | table.sort(smwdata, function(a, b) return b['Store sell price'] < a['Store sell price'] end) | ||
-- Iterate through each shop instance of item | -- Iterate through each shop instance of item | ||
| Line 146: | Line 138: | ||
end | end | ||
-- Loop over smw return items | -- Loop over smw return items | ||
| Line 154: | Line 145: | ||
local dataline = p.processData(item, editbtn) | local dataline = p.processData(item, editbtn) | ||
| Line 182: | Line 172: | ||
local currency = item['Store currency'] | local currency = item['Store currency'] | ||
local sellvalue = item['Store sell price'] or '' | local sellvalue = item['Store sell price'] or '' | ||
local sellSortValue = 0 | local sellSortValue = 0 | ||
if not(sellvalue == 1e10) then | if not(sellvalue == 1e10) then | ||
sellvalue = tonumber(sellvalue) | sellvalue = tonumber(sellvalue) | ||
if sellvalue then | if sellvalue then | ||
sellSortValue = sellvalue | sellSortValue = sellvalue | ||
sellvalue = commas(sellvalue) | sellvalue = commas(sellvalue) | ||
local currencyImg = '' | local currencyImg = '' | ||
if(params.has_content(currencyImg)) then | |||
sellvalue = string.format('%s [[%s]]', sellvalue, currency) | |||
end | -- if(params.has_content(currencyImg)) then | ||
-- currencyImg = string.format('[[File:%s|link=%s]] ', currencyImg, currency) | |||
-- sellvalue = currencyImg .. sellvalue | |||
-- end | |||
else | else | ||
sellvalue = editbtn -- If sellvalue can't be converted to a number it will default to the edit button | sellvalue = editbtn -- If sellvalue can't be converted to a number it will default to the edit button | ||