When div by 0, still display usefull info

This commit is contained in:
Gerko de Roo 2010-06-13 12:16:26 +02:00
parent 1c238e4119
commit 1279c8d67e

View File

@ -543,8 +543,10 @@ def agg_fact(stat_dict, player):
bet_raise = stat_dict[player]['aggr_1'] + stat_dict[player]['aggr_2'] + stat_dict[player]['aggr_3'] + stat_dict[player]['aggr_4']
post_call = stat_dict[player]['call_1'] + stat_dict[player]['call_2'] + stat_dict[player]['call_3'] + stat_dict[player]['call_4']
stat = float (bet_raise) / float(post_call)
if post_call > 0:
stat = float (bet_raise) / float(post_call)
else:
stat = bet_raise
return (stat,
'%2.2f' % (stat) ,
'afa=%2.2f' % (stat) ,