Module:Monsters: Difference between revisions

Forcing 2 digit drop chances for cleanliness
(Right-aligning drop chance numbers)
(Forcing 2 digit drop chances for cleanliness)
Line 399: Line 399:


       local dropChance = (row[2] / totalWt * lootChance)
       local dropChance = (row[2] / totalWt * lootChance)
       result = result..'||style="text-align:right"|'..Shared.round(dropChance, 2, 0)..'%'
       result = result..'||style="text-align:right"|'..Shared.round(dropChance, 2, 2)..'%'
     end
     end
     if multiDrop then
     if multiDrop then
       --result = result..'\r\n|-\r\n|colspan="2"|Total:||'..Shared.formatnum(totalWt)..'||'..lootChance..'%'
       --result = result..'\r\n|-\r\n|colspan="2"|Total:||'..Shared.formatnum(totalWt)..'||'..lootChance..'%'
       result = result..'\r\n|-\r\n!colspan="2"|Total:\r\n|style="text-align:right"'..lootChance..'%'
       result = result..'\r\n|-\r\n!colspan="2"|Total:\r\n|style="text-align:right"'..lootChance..'.00%'
     end
     end
     result = result..'\r\n|}'
     result = result..'\r\n|}'