From 1279c8d67ea86d45da1982498f1f9b0c526a3213 Mon Sep 17 00:00:00 2001 From: Gerko de Roo Date: Sun, 13 Jun 2010 12:16:26 +0200 Subject: [PATCH] When div by 0, still display usefull info --- pyfpdb/Stats.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyfpdb/Stats.py b/pyfpdb/Stats.py index 1d4a46fd..654d1652 100755 --- a/pyfpdb/Stats.py +++ b/pyfpdb/Stats.py @@ -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) ,