I am working on a Hockey Pool stat project. My PPG column is a calculation that divides PTS by GP. This works fine for anyone that has played a game. However, in the case of Rookies or the very beginning of the season the GP number is 0. As such, when it is "0" it returns a DIVISION BY ZERO error. Instead of this error, I would like to simply return the result to be "0.00". I have not had any success finding a solution. Hoping someone can help!
Here is the code that I have been using for this column of my query output.
echo number_format($row['PTS0910']/$row['GP0910'],2);
thanks in advance everyone!
Cheers,
Chris