From 1a515534b42ae426027399764bf155e0f71acc0e Mon Sep 17 00:00:00 2001 From: Mika Bostrom Date: Tue, 31 Aug 2010 11:40:21 +0300 Subject: [PATCH] Try to fix profit/100 --- pyfpdb/Stats.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyfpdb/Stats.py b/pyfpdb/Stats.py index 3616fa87..a9dd137f 100755 --- a/pyfpdb/Stats.py +++ b/pyfpdb/Stats.py @@ -228,15 +228,17 @@ def wmsd(stat_dict, player): _('% won money at showdown') ) +# Money is stored as pennies, so there is an implicit 100-multiplier +# already in place def profit100(stat_dict, player): """ Profit won per 100 hands.""" stat = 0.0 try: stat = float(stat_dict[player]['net'])/float(stat_dict[player]['n']) return (stat, - '%.0f' % (100.0*stat), - 'p=%.0f' % (100.0*stat), - 'p/100=%.0f' % (100.0*stat), + '%.2f' % (stat), + 'p=%.2f' % (stat), + 'p/100=%.2f' % (stat), '%d/%d' % (stat_dict[player]['net'], stat_dict[player]['n']), _('profit/100hands') )