From 5496c96b32f662b266e48fa4e23d86433cf287a5 Mon Sep 17 00:00:00 2001 From: Cal Corum Date: Tue, 9 Dec 2025 20:16:47 -0600 Subject: [PATCH] Standardize sWAR display formatting to 2 decimal places MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed 10 locations with inconsistent WAR formatting: cogs/transactions.py: - Line 343: Trade player display - Line 910: Week transaction display - Lines 1296, 1783, 2084: Roster error displays (now >5.2f) - Lines 2166, 2175: Guaranteed/frozen move displays - Line 2303: MiL demotion display cogs/draft.py: - Line 218: Core players display cogs/players.py: - Line 2859: Player update display (both old and new values) All user-facing sWAR values now consistently use :.2f format. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- cogs/draft.py | 2 +- cogs/players.py | 2 +- cogs/transactions.py | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cogs/draft.py b/cogs/draft.py index 51111b7..a21c7e7 100644 --- a/cogs/draft.py +++ b/cogs/draft.py @@ -215,7 +215,7 @@ class Draft(commands.Cog): for x in p_query['players']: if count < 5: - core_players_string += f'{x["pos_1"]} {x["name"]} ({x["wara"]})\n' + core_players_string += f'{x["pos_1"]} {x["name"]} ({x["wara"]:.2f})\n' else: break count += 1 diff --git a/cogs/players.py b/cogs/players.py index 39688e4..7e9fd25 100644 --- a/cogs/players.py +++ b/cogs/players.py @@ -2856,7 +2856,7 @@ class Players(commands.Cog): update_string = '' if swar is not None: - update_string += f'sWAR: {this_player["wara"]} => {swar}\n' + update_string += f'sWAR: {this_player["wara"]:.2f} => {swar:.2f}\n' this_player['wara'] = swar if injury_rating is not None: update_string += f'injury_rating: {this_player["injury_rating"]} => {injury_rating}\n' diff --git a/cogs/transactions.py b/cogs/transactions.py index 7879eb2..3291fab 100644 --- a/cogs/transactions.py +++ b/cogs/transactions.py @@ -340,7 +340,7 @@ class SBaTransaction: # Get player string player_string = '' for x in self.players: - player_string += f'**{self.players[x]["player"]["name"]}** ({self.players[x]["player"]["wara"]}) from ' \ + player_string += f'**{self.players[x]["player"]["name"]}** ({self.players[x]["player"]["wara"]:.2f}) from ' \ f'{self.players[x]["player"]["team"]["abbrev"]} to {self.players[x]["to"]["abbrev"]}\n' if len(player_string) == 0: @@ -907,7 +907,7 @@ class Transactions(commands.Cog): if week_num is None: week_num = move['week'] - move_string += f'**{move["player"]["name"]}** ({move["player"]["wara"]}) from ' \ + move_string += f'**{move["player"]["name"]}** ({move["player"]["wara"]:.2f}) from ' \ f'{move["oldteam"]["abbrev"]} to {move["newteam"]["abbrev"]}\n' embed = get_team_embed(f'Week {week_num} Transaction', this_team) @@ -1293,7 +1293,7 @@ class Transactions(commands.Cog): if (exceeds_salary_cap(data['wara'], team_obj) or len(data['roster']) > 26) and not OFFSEASON_FLAG: roster_string = '' for x in data['roster']: - roster_string += f'{x["wara"]: >5} - {x["name"]}\n' + roster_string += f'{x["wara"]: >5.2f} - {x["name"]}\n' roster_errors.append(f'- This is the roster I have for {trade.teams[team]["team"]["abbrev"]}:\n' f'```\n{roster_string}```') @@ -1780,7 +1780,7 @@ class Transactions(commands.Cog): if (exceeds_salary_cap(data['wara'], team_obj) or len(data['roster']) > 26) and not OFFSEASON_FLAG: roster_string = '' for x in data['roster']: - roster_string += f'{x["wara"]: >5} - {x["name"]}\n' + roster_string += f'{x["wara"]: >5.2f} - {x["name"]}\n' errors.append(f'- This is the roster I have for {team_obj["abbrev"]}:\n' f'```\n{roster_string}```') @@ -2081,7 +2081,7 @@ class Transactions(commands.Cog): if (exceeds_salary_cap(data['wara'], team_obj) or len(data['roster']) > 26) and not OFFSEASON_FLAG: roster_string = '' for x in data['roster']: - roster_string += f'{x["wara"]: >5} - {x["name"]}\n' + roster_string += f'{x["wara"]: >5.2f} - {x["name"]}\n' errors.append(f'- This is the roster I have for {team_obj["abbrev"]}:\n' f'```\n{roster_string}```') @@ -2163,7 +2163,7 @@ class Transactions(commands.Cog): guaranteed[x["moveid"]] = [] guaranteed[x["moveid"]].append( - f'**{x["player"]["name"]}** ({x["player"]["wara"]}) from ' + f'**{x["player"]["name"]}** ({x["player"]["wara"]:.2f}) from ' f'{x["oldteam"]["abbrev"]} to {x["newteam"]["abbrev"]}\n' ) @@ -2172,7 +2172,7 @@ class Transactions(commands.Cog): frozen[x["moveid"]] = [] frozen[x["moveid"]].append( - f'**{x["player"]["name"]}** ({x["player"]["wara"]}) from ' + f'**{x["player"]["name"]}** ({x["player"]["wara"]:.2f}) from ' f'{x["oldteam"]["abbrev"]} to {x["newteam"]["abbrev"]}\n' ) @@ -2300,7 +2300,7 @@ class Transactions(commands.Cog): if player['team']['id'] != team['id']: await ctx.send(f'Omg stop trying to make {player["name"]} happen. It\'s not going to happen.') else: - output_string += f'**{player["name"]}** ({player["wara"]}) to MiL\n' + output_string += f'**{player["name"]}** ({player["wara"]:.2f}) to MiL\n' if player['team']['id'] == team['id']: moves.append({ 'week': 1,