fix: round refractor values to integers in display
All checks were successful
Ruff Lint / lint (pull_request) Successful in 19s

Cast current_value and next_threshold to int to avoid ugly floating
point numbers like 53.0/149.0 in the progress display.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Cal Corum 2026-03-25 16:55:03 -05:00
parent 27ce8b3617
commit 8d2cdc81fe

View File

@ -77,8 +77,8 @@ def format_refractor_entry(card_state: dict) -> str:
track = card_state.get("track", {})
card_type = track.get("card_type", "batter")
current_tier = card_state.get("current_tier", 0)
formula_value = card_state.get("current_value", 0)
next_threshold = card_state.get("next_threshold")
formula_value = int(card_state.get("current_value", 0))
next_threshold = int(card_state.get("next_threshold") or 0) or None
tier_label = TIER_NAMES.get(current_tier, f"T{current_tier}")
formula_label = FORMULA_LABELS.get(card_type, card_type)
@ -107,11 +107,11 @@ def apply_close_filter(card_states: list) -> list:
result = []
for state in card_states:
current_tier = state.get("current_tier", 0)
formula_value = state.get("current_value", 0)
formula_value = int(state.get("current_value", 0))
next_threshold = state.get("next_threshold")
if current_tier >= 4 or not next_threshold:
continue
if formula_value >= 0.8 * next_threshold:
if formula_value >= 0.8 * int(next_threshold):
result.append(state)
return result