From 6e294b6c1f2ddc9377f6b2e43462dbbd84b99125 Mon Sep 17 00:00:00 2001 From: Dmitrii Morozov Date: Fri, 16 Aug 2024 11:58:28 +0200 Subject: Fix formatting of level changes during season change --- formatter/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/formatter/__init__.py b/formatter/__init__.py index 91270de..79fa6c7 100644 --- a/formatter/__init__.py +++ b/formatter/__init__.py @@ -69,15 +69,15 @@ def __format_stats_difference(old_user_stats: UserStats, new_user_stats: UserSta separator='\n') def __format_stat_difference(old_stat_value: int, new_stat_value: int): - if old_stat_value != new_stat_value: - difference = max(0, new_stat_value - old_stat_value) + difference = max(0, new_stat_value - old_stat_value) + if difference > 0: return " \(\+ {}\)".format(str(difference)) else: return "" def __format_minutes_difference(old_minutes: int, new_minutes: int): - if old_minutes != new_minutes: - difference = max(0, new_minutes - old_minutes) + difference = max(0, new_minutes - old_minutes) + if difference > 0: return " \(\+ {}\)".format(__format_minutes(difference)) else: return "" -- cgit v1.2.3