prevent divisons by zero for progress bars
This commit is contained in:
parent
51ce52c539
commit
6c5fbb3f22
5 changed files with 7 additions and 7 deletions
|
|
@ -57,9 +57,9 @@
|
|||
</div>
|
||||
<h2><?=_('Personal Achievements')?></h2>
|
||||
<div class="libindxpr cf">
|
||||
<p><small><?=sprintf(_('Own progress: %d %%'), round(count($achievedAchievements) / $achievementsCount * 100))?></small></p>
|
||||
<p><small><?=sprintf(_('Own progress: %d %%'), ($achievementsCount > 0 ? round(count($achievedAchievements) / $achievementsCount * 100) : 0))?></small></p>
|
||||
<div class="xpbar">
|
||||
<span style="width:<?=round(count($achievedAchievements) / $achievementsCount * 100)?>%"></span>
|
||||
<span style="width:<?=($achievementsCount > 0) ? round(count($achievedAchievements) / $achievementsCount * 100) : 0?>%"></span>
|
||||
</div>
|
||||
</div>
|
||||
<p><small><b><?=$character['rank']?>. <?=_('Rank')?>:</b> <?=sprintf(_('You achieved %d of %d Achievements so far'), count($achievedAchievements), $achievementsCount)?>.</small></p>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue