mattygriff
Programmer
Please look at the following code :
I have highlighted two calculations in red. The first one works OK but the second returns a "division by zero" error.
How can this be when they both use the same denominator???
Code:
<%
if intWickets = 0 then
decBowlAv = 0
else
[COLOR=red]decBowlAv = formatnumber((intRuns/intWickets),2)[/color]
end if
response.write decBowlAv
%>
</td>
<td width="50"><h6>
<%
intBallsBowled = (int(decOvers)*6) + intTotBalls
if intBallsBowled = 0 then
decStrikeRate = 0
else
[COLOR=red]decStrikeRate = formatnumber((intBallsBowled/intWickets),2)[/color]
end if
response.write decStrikeRate
%>
How can this be when they both use the same denominator???