621
edits
(attempting to add a display of the average value of an action similar to template:chestDrops) |
(attempting to fix the math...?) |
||
Line 104: | Line 104: | ||
local fmt = (dropChance < 0.10 and '%.2g') or '%.2f' | local fmt = (dropChance < 0.10 and '%.2g') or '%.2f' | ||
table.insert(result, 'style="text-align:right"|'..string.format(fmt, dropChance * 100)..'%') | table.insert(result, 'style="text-align:right"|'..string.format(fmt, dropChance * 100)..'%') | ||
lootValue = lootValue + (dropChance * 0.01 * thisItem. | lootValue = lootValue + (dropChance * 0.01 * thisItem.itemPrice * ((row.minQuantity + row.maxQuantity)/ 2)) | ||
end | end | ||