Module:Monsters: Difference between revisions

Right-aligning fractions
(MonsterDrops: Now with fractions)
(Right-aligning fractions)
Line 408: Line 408:


       local dropChance = (row[2] / totalWt * lootChance)
       local dropChance = (row[2] / totalWt * lootChance)
       result = result..'||'..Shared.fraction(row[2] * lootChance, totalWt * 100)
       result = result..'||style="text-align:right"|'..Shared.fraction(row[2] * lootChance, totalWt * 100)
       result = result..'||style="text-align:right"|'..Shared.round(dropChance, 2, 2)..'%'
       result = result..'||style="text-align:right"|'..Shared.round(dropChance, 2, 2)..'%'
     end
     end
Line 414: Line 414:
       result = result..'\r\n|-class="sortbottom" \r\n!colspan="2"|Total:'
       result = result..'\r\n|-class="sortbottom" \r\n!colspan="2"|Total:'
       if lootChance < 100 then
       if lootChance < 100 then
         result = result..'\r\n|'..Shared.fraction(lootChance, 100)..'||'
         result = result..'\r\n|style="text-align:right"|'..Shared.fraction(lootChance, 100)..'||'
       else
       else
         result = result..'\r\n|colspan="2" '
         result = result..'\r\n|colspan="2" '