2,875
edits
No edit summary |
No edit summary |
||
Line 820: | Line 820: | ||
table.insert(rowPart, '\r\n|colspan="2" ') | table.insert(rowPart, '\r\n|colspan="2" ') | ||
else | else | ||
local fraction = | local fraction = Num.fraction(weight, totalWeight) | ||
if Shared.contains(fraction, '%.') then | if Shared.contains(fraction, '%.') then | ||
--If fraction contains decimals, something screwy happened so just show only percentage | --If fraction contains decimals, something screwy happened so just show only percentage | ||
Line 826: | Line 826: | ||
table.insert(rowPart, '\r\n|colspan="2" ') | table.insert(rowPart, '\r\n|colspan="2" ') | ||
else | else | ||
table.insert(rowPart, '\r\n|style="text-align: right;" data-sort-value="' .. chanceStr .. '"| ' .. | table.insert(rowPart, '\r\n|style="text-align: right;" data-sort-value="' .. chanceStr .. '"| ' .. Num.fraction(weight, totalWeight) .. '\r\n|') | ||
end | end | ||
end | end | ||
Line 1,303: | Line 1,303: | ||
chance = chance * lootChance | chance = chance * lootChance | ||
weight = weight * 100 | weight = weight * 100 | ||
chance, weight = | chance, weight = Num.fractionpair(chance, weight) | ||
end | end | ||
if chance > 0 then | if chance > 0 then |
edits