1
I’m having trouble with a php page. Whenever I put the following code to do the division of two variables stored in arrays
$dj_cv_at[percentual][$i] = ($dj_cv_at[concluida_c_imp_total][$i] / $dj_cv_at[concluida_total][$i]) * 100;
As a result the page stops working properly.
This only happens when I put the split operator. With the other operators the code runs perfectly.
gives some error, appears? is problem with division by zero? wrong decimal places? could detail better the problem.
– rray
Thanks, pal, I got it. The problem was related to the division of 0 by 0. To solve the problem I did so: if ($dj_cv_at[concluida_c_imp_total][$i] == 0){ $dj_cv_at[percentage][$i] = 0; } Else {$dj_cv_at[percentage][$i] =($dj_cv_at[concluida_c_imp_total][$i] / $dj_cv_at[concluida_total][$i]) * 100;}
– Richard Palmas