Skip to content

Commit e28b196

Browse files
author
Hystepik
committed
Fix #29843 warning division by zero
1 parent 699d504 commit e28b196

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

htdocs/compta/stats/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@
461461
//var_dump($annee.' '.$year_end.' '.$mois.' '.$month_end);
462462
if ($annee < $year_end || ($annee == $year_end && $mois <= $month_end)) {
463463
if ($annee_decalage > $minyear && $case <= $casenow) {
464-
if (!empty($cum[$caseprev]) && !empty($cum[$case])) {
464+
if (!empty($cum[$caseprev]) && !empty($cum[$case]) && $cum[$caseprev] != 0) {
465465
$percent = (round(($cum[$case] - $cum[$caseprev]) / $cum[$caseprev], 4) * 100);
466466
//print "X $cum[$case] - $cum[$caseprev] - $cum[$caseprev] - $percent X";
467467
print($percent >= 0 ? "+$percent" : "$percent").'%';

0 commit comments

Comments
 (0)