Skip to content

Commit

Permalink
Merge pull request #12 from Monadical-SAS/afreydev/fix-yacron-zero-di…
Browse files Browse the repository at this point in the history
…vision

Fixed zero division
  • Loading branch information
afreydev committed Jul 24, 2023
2 parents 0c63889 + 91f2252 commit 7693720
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/oddslingers/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,16 @@ def todays_winnings(username):
user_summary = '\n - '.join(user_desc(u) for u in sorted(new_signups, key=lambda u: -u.hands_played))
player_summary = '\n - '.join(player_desc(username, hands) for username, hands in sorted(top_players.items(), key=lambda p: -p[1]))

hands_by_user = 0
if total_users != 0:
hands_by_user = round((total_hands / 1000)/total_users, 1)

report_msg = f"""
**All-time:**
- Hands Played: {round(total_hands / 1000000, 1)}mm
- Tables: {total_tables}
- Users: {total_users} users (avg {round((total_hands / 1000)/total_users, 1)}k hands/user)
- Users: {total_users} users (avg {hands_by_user}k hands/user)
**{new_signups.count()} New signups since yesterday:**
Expand Down

0 comments on commit 7693720

Please sign in to comment.