Skip to content

Commit

Permalink
add decimal days
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennanB committed Aug 14, 2024
1 parent 0af5343 commit 863e92c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion highscores/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def world_records(request: HttpRequest) -> HttpResponse:
months, remainder = divmod(remainder, 2592000) # 60*60*24*30
days, _ = divmod(remainder, 86400) # 60*60*24

record.active_for = f"{int(years)} years, {int(months)} months, {int(days)} days"
record.active_for = f"{int(years)} years, {int(months)} months, {days:.1f} days"

# Count the number of records per player
player_counts = Counter(record.player.username for record in world_records)
Expand Down

0 comments on commit 863e92c

Please sign in to comment.