From 9557117a16b78b3be4297760bbb1804f32d7f9a6 Mon Sep 17 00:00:00 2001 From: eblade Date: Thu, 26 Feb 2009 09:27:59 -0500 Subject: [PATCH] add "totalprofit" stat --- pyfpdb/Stats.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyfpdb/Stats.py b/pyfpdb/Stats.py index 0870c73e..cad3af88 100644 --- a/pyfpdb/Stats.py +++ b/pyfpdb/Stats.py @@ -70,6 +70,13 @@ def do_stat(stat_dict, player = 24, stat = 'vpip'): ########################################### # functions that return individual stats +def totalprofit(stat_dict, player): + """ Total Profit.""" + if stat_dict[player]['net'] != 0: + stat = float(stat_dict[player]['net']) / 100 + return (stat, '$%.2f' % stat, 'tp=$%.2f' % stat, 'totalprofit=$%.2f' % stat, str(stat), 'Total Profit') + return ('0', '0', '0', '0', 'Total Profit') + def playername(stat_dict, player): """ Player Name.""" return (stat_dict[player]['screen_name'],