Module:Skills/Archaeology: Difference between revisions

attempting to fix the math...?
(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.sellsFor * ((row.minQuantity + row.maxQuantity)/ 2))
lootValue = lootValue + (dropChance * 0.01 * thisItem.itemPrice * ((row.minQuantity + row.maxQuantity)/ 2))
end
end
587

edits