mirror of
https://github.com/MadeBaruna/paimon-moe.git
synced 2024-11-29 03:32:44 +01:00
Fix division by zero
This commit is contained in:
parent
b9bac1ac7b
commit
8f65587ce3
2 changed files with 4 additions and 4 deletions
|
@ -102,7 +102,7 @@
|
|||
{numberFormat.format((banner.rare.character.length / banner.total) * 100)}%
|
||||
</td>
|
||||
<td class="text-rare-from font-semibold text-right border-t border-gray-700">
|
||||
{rareTotal > 0 ? numberFormat.format(rarePityCharacter / banner.rare.character.length) : 0}
|
||||
{banner.rare.character.length > 0 ? numberFormat.format(rarePityCharacter / banner.rare.character.length) : 0}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -116,7 +116,7 @@
|
|||
{numberFormat.format((banner.rare.weapon.length / banner.total) * 100)}%
|
||||
</td>
|
||||
<td class="text-rare-from font-semibold text-right border-t border-gray-700">
|
||||
{rareTotal > 0 ? numberFormat.format(rarePityWeapon / banner.rare.weapon.length) : 0}
|
||||
{banner.rare.weapon.length > 0 ? numberFormat.format(rarePityWeapon / banner.rare.weapon.length) : 0}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -187,12 +187,12 @@
|
|||
weapon: {
|
||||
total: rareWeapon,
|
||||
percentage: total > 0 ? rareWeapon / total : 0,
|
||||
pity: rare > 0 ? rarePityWeapon / rareWeapon : 0,
|
||||
pity: rareWeapon > 0 ? rarePityWeapon / rareWeapon : 0,
|
||||
},
|
||||
character: {
|
||||
total: rareCharacter,
|
||||
percentage: total > 0 ? rareCharacter / total : 0,
|
||||
pity: rare > 0 ? rarePityCharacter / rareCharacter : 0,
|
||||
pity: rareCharacter > 0 ? rarePityCharacter / rareCharacter : 0,
|
||||
},
|
||||
},
|
||||
legendary: {
|
||||
|
|
Loading…
Reference in a new issue