Standardize sWAR display formatting to 2 decimal places

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 <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2025-12-09 20:16:47 -06:00
parent 4bd5a0b786
commit 5496c96b32
3 changed files with 10 additions and 10 deletions

View File

@ -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

View File

@ -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'

View File

@ -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,