Skip to content

BUG - Division 0 in $users. - #47

Open
bunchaban wants to merge 1 commit into
advocaite:masterfrom
bunchaban:patch-1
Open

BUG - Division 0 in $users.#47
bunchaban wants to merge 1 commit into
advocaite:masterfrom
bunchaban:patch-1

Conversation

@bunchaban

Copy link
Copy Markdown

:)

@derilevi

Copy link
Copy Markdown

I think this is a better solution:
if ($users!=0) { $percents = 100 * (($tribes[0]-2) / $users); }
else
{ $percents=0; }

https://github.com/derilevi/Travianx/blob/master/Templates/Ranking/general.tpl

@ZZJHONS

ZZJHONS commented Nov 21, 2011

Copy link
Copy Markdown

No, this:
if ($users > 0){$percents = 100*($tribes[0] / $users);} else {$percents=0; }

PD: Change the tribe array: $tribes[0], $tribes[1], $tribes[2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants