2,875
edits
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
-- Guarantee order by iterating through currency game data definition | -- Guarantee order by iterating through currency game data definition | ||
local currID = currencyDefn.id | local currID = currencyDefn.id | ||
local val = | local val = Num.round(lootValue[currID], 2, 2) | ||
if val ~= nil then | if val ~= nil then | ||
table.insert(returnPart, Icons._Currency(currID, val)) | table.insert(returnPart, Icons._Currency(currID, val)) | ||
Line 67: | Line 67: | ||
local sellCurrency = log.sellsForCurrency or 'melvorD:GP' | local sellCurrency = log.sellsForCurrency or 'melvorD:GP' | ||
local XPSec = baseXP / (baseInt / 1000) | local XPSec = baseXP / (baseInt / 1000) | ||
local currSec = | local currSec = Num.round(log.sellsFor / (baseInt / 1000), 2, 2) | ||
Line 89: | Line 89: | ||
:attr('data-sort-value', baseInt) | :attr('data-sort-value', baseInt) | ||
:css('text-align', 'right') | :css('text-align', 'right') | ||
:tag('td'):wikitext( | :tag('td'):wikitext(Num.round(XPSec, 2, 2)) | ||
:css('text-align', 'right') | :css('text-align', 'right') | ||
:tag('td'):wikitext(Icons._Currency(sellCurrency, currSec)) | :tag('td'):wikitext(Icons._Currency(sellCurrency, currSec)) | ||
Line 428: | Line 428: | ||
row:tag('td') | row:tag('td') | ||
:css('text-align', 'right') | :css('text-align', 'right') | ||
:wikitext( | :wikitext(Num.round(XPSec, 2, 2)) | ||
end | end | ||
end | end | ||
Line 544: | Line 544: | ||
:css('text-align', 'right') | :css('text-align', 'right') | ||
:attr('data-sort-value', odds) | :attr('data-sort-value', odds) | ||
:wikitext( | :wikitext(Num.fraction(1, Num.round2(1/(odds/100), 0))) | ||
row:tag('td') | row:tag('td') | ||
:css('text-align', 'right') | :css('text-align', 'right') | ||
:attr('data-sort-value', odds) | :attr('data-sort-value', odds) | ||
:wikitext( | :wikitext(Num.round(odds, 4, 4) .. '%') | ||
end | end | ||
end | end | ||
Line 623: | Line 623: | ||
--Show fraction as long as it isn't going to be 1/1 | --Show fraction as long as it isn't going to be 1/1 | ||
table.insert(normalTxt, '||style="text-align:right" data-sort-value="'..loot.weight..'"') | table.insert(normalTxt, '||style="text-align:right" data-sort-value="'..loot.weight..'"') | ||
table.insert(normalTxt, '|'.. | table.insert(normalTxt, '|'..Num.fraction(loot.weight * lootChance, totalWt * 100)) | ||
table.insert(normalTxt, '||') | table.insert(normalTxt, '||') | ||
else | else | ||
table.insert(normalTxt, '||colspan="2" data-sort-value="'..loot.weight..'"') | table.insert(normalTxt, '||colspan="2" data-sort-value="'..loot.weight..'"') | ||
end | end | ||
table.insert(normalTxt, 'style="text-align:right"|'.. | table.insert(normalTxt, 'style="text-align:right"|'..Num.round(dropChance, 2, 2)..'%') | ||
--Adding to the average loot value based on price & dropchance | --Adding to the average loot value based on price & dropchance | ||
Line 645: | Line 645: | ||
table.insert(normalTxt, '\r\n|colspan="2" ') | table.insert(normalTxt, '\r\n|colspan="2" ') | ||
end | end | ||
table.insert(normalTxt, 'style="text-align:right"|'.. | table.insert(normalTxt, 'style="text-align:right"|'..Num.round(lootChance, 2, 2)..'%') | ||
end | end | ||
table.insert(normalTxt, '\r\n|}') | table.insert(normalTxt, '\r\n|}') | ||
Line 680: | Line 680: | ||
lineTxt = lineTxt..'\r\n|-\r\n|'..Icons.Icon({thisItem.name, type='item'}) | lineTxt = lineTxt..'\r\n|-\r\n|'..Icons.Icon({thisItem.name, type='item'}) | ||
lineTxt = lineTxt..'||data-sort-value="'..drop.quantity..'"| '..Num.formatnum(drop.quantity)..'||data-sort-value="'..thisItem.sellsFor..'"|'..Items.getValueText(thisItem) | lineTxt = lineTxt..'||data-sort-value="'..drop.quantity..'"| '..Num.formatnum(drop.quantity)..'||data-sort-value="'..thisItem.sellsFor..'"|'..Items.getValueText(thisItem) | ||
lineTxt = lineTxt..'||style="text-align:right"|'.. | lineTxt = lineTxt..'||style="text-align:right"|'..Num.fraction(1, 1/(SkillData.Thieving.baseAreaUniqueChance/100)) | ||
lineTxt = lineTxt..'||'.. | lineTxt = lineTxt..'||'..Num.round(SkillData.Thieving.baseAreaUniqueChance, 2, 2)..'%' | ||
dropLines[thisItem.name] = lineTxt | dropLines[thisItem.name] = lineTxt | ||
end | end |
edits