diff options
Diffstat (limited to 'jfr_playoff/dto.py')
-rw-r--r-- | jfr_playoff/dto.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jfr_playoff/dto.py b/jfr_playoff/dto.py index 169eda0..28aa446 100644 --- a/jfr_playoff/dto.py +++ b/jfr_playoff/dto.py @@ -1,3 +1,4 @@ +from math import ceil, floor import sys def coalesce(*arg): @@ -15,6 +16,15 @@ class Team(object): known_teams = 0 selected_team = -1 + @property + def league_carry_over(self): + if self.score == 0.0: + return 0.0 + carry_over = ceil(10 * self.score) / 10.0 + if carry_over.is_integer(): + carry_over = floor(10 * self.score) / 10.0 + return carry_over + def __init__(self): self.place = [] self.name = [] |