From 4605b371f1339417e9bf90c10d8544eff40fffea Mon Sep 17 00:00:00 2001 From: Worros Date: Fri, 11 Feb 2011 00:02:45 +0800 Subject: [PATCH] Winamax: Fix tournament buyin and rake info --- pyfpdb/WinamaxToFpdb.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pyfpdb/WinamaxToFpdb.py b/pyfpdb/WinamaxToFpdb.py index b8b5ed1e..9d4721ec 100644 --- a/pyfpdb/WinamaxToFpdb.py +++ b/pyfpdb/WinamaxToFpdb.py @@ -276,8 +276,15 @@ class Winamax(HandHistoryConverter): hand.isKO = False info['BIRAKE'] = info['BIRAKE'].strip(u'$€') - hand.buyin = int(100*Decimal(info['BIAMT'])) - hand.fee = int(100*Decimal(info['BIRAKE'])) + rake_factor = 1 + bi_factor = 1 + if info['BIAMT'].find(".") == -1: + bi_factor = 100 + if info['BIRAKE'].find(".") == -1: + rake_factor = 100 + + hand.buyin = bi_factor*info['BIAMT'] + hand.fee = rake_factor*info['BIRAKE'] else: hand.buyin = int(Decimal(info['BIAMT'])) hand.fee = 0