Tourney parsing : Use of "Decimal" insted of float2int / Handle amounts in cents four Tourney Object

This commit is contained in:
PassThePeas
2009-09-01 23:46:46 +02:00
parent b00a58249f
commit 4a0b2274f8
2 changed files with 21 additions and 21 deletions
+1 -2
View File
@@ -260,10 +260,9 @@ db: a connected fpdb_db object"""
Adds a player to the tourney, and initialises data structures indexed by player.
rank (int) indicating the finishing rank (can be -1 if unknown)
name (string) player name
winnings (string) the money the player ended the tourney with (can be 0, or -1 if unknown)
winnings (decimal) the money the player ended the tourney with (can be 0, or -1 if unknown)
"""
log.debug("addPlayer: rank:%s - name : '%s' - Winnings (%s)" % (rank, name, winnings))
winnings = re.sub(u',', u'', winnings) #some sites have commas
self.players.append(name)
self.finishPositions.update( { name : Decimal(rank) } )
self.winnings.update( { name : Decimal(winnings) } )