]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Make the value a real percentile, if I am going to call it that :)
authorAnt Zucaro <azucaro@gmail.com>
Fri, 28 Sep 2012 02:41:12 +0000 (22:41 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Fri, 28 Sep 2012 02:41:12 +0000 (22:41 -0400)
xonstat/views/player.py

index 0c4ce59bcfcfee888b6126dbe49722bdb7b8cd0d..a03ab6c7f94bb777dbcc2057635c2a38e3a3985c 100644 (file)
@@ -347,12 +347,12 @@ def get_ranks(player_id):
             max_rank=row.max_rank,
             game_type_cd=row.game_type_cd)
 
-        percentile = float(row.rank)/row.max_rank
+        percentile = 100 - float(row.rank)/row.max_rank
 
         if not found_top_rank:
             ranks['overall'] = rank
             found_top_rank = True
-        elif percentile < float(ranks['overall'].rank)/ranks['overall'].max_rank:
+        elif percentile > 100 - float(ranks['overall'].rank)/ranks['overall'].max_rank:
             ranks['overall'] = rank
 
         ranks[row.game_type_cd] = rank