Fix character/weapon average pity calculation

This commit is contained in:
Vilim Lendvaj 2021-05-03 23:49:01 +02:00
parent 96ddf54859
commit b9bac1ac7b
2 changed files with 4 additions and 4 deletions

View file

@ -102,7 +102,7 @@
{numberFormat.format((banner.rare.character.length / banner.total) * 100)}% {numberFormat.format((banner.rare.character.length / banner.total) * 100)}%
</td> </td>
<td class="text-rare-from font-semibold text-right border-t border-gray-700"> <td class="text-rare-from font-semibold text-right border-t border-gray-700">
{rareTotal > 0 ? numberFormat.format(rarePityCharacter / rareTotal) : 0} {rareTotal > 0 ? numberFormat.format(rarePityCharacter / banner.rare.character.length) : 0}
</td> </td>
</tr> </tr>
<tr> <tr>
@ -116,7 +116,7 @@
{numberFormat.format((banner.rare.weapon.length / banner.total) * 100)}% {numberFormat.format((banner.rare.weapon.length / banner.total) * 100)}%
</td> </td>
<td class="text-rare-from font-semibold text-right border-t border-gray-700"> <td class="text-rare-from font-semibold text-right border-t border-gray-700">
{rareTotal > 0 ? numberFormat.format(rarePityWeapon / rareTotal) : 0} {rareTotal > 0 ? numberFormat.format(rarePityWeapon / banner.rare.weapon.length) : 0}
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -187,12 +187,12 @@
weapon: { weapon: {
total: rareWeapon, total: rareWeapon,
percentage: total > 0 ? rareWeapon / total : 0, percentage: total > 0 ? rareWeapon / total : 0,
pity: rare > 0 ? rarePityWeapon / rare : 0, pity: rare > 0 ? rarePityWeapon / rareWeapon : 0,
}, },
character: { character: {
total: rareCharacter, total: rareCharacter,
percentage: total > 0 ? rareCharacter / total : 0, percentage: total > 0 ? rareCharacter / total : 0,
pity: rare > 0 ? rarePityCharacter / rare : 0, pity: rare > 0 ? rarePityCharacter / rareCharacter : 0,
}, },
}, },
legendary: { legendary: {