fix: UI discounts standard display

This commit is contained in:
DEsimas 2024-12-20 01:19:57 +03:00
parent b0aba2366d
commit 87d63abe8d
1 changed files with 1 additions and 1 deletions

View File

@ -15,4 +15,4 @@ class Game:
def __str__(self):
cleaned_string = self.price.replace("\u202f", "")[:-2]
cleaned_string = cleaned_string.replace(",", ".")
return f"{self.name}\nЖанр: {self.genre}\nИздатель: {self.publisher}\n" + (str(self.price) if self.discount is None else f"{math.ceil(float(cleaned_string) * (100 - self.discount) / 100)} ₽ -{self.discount}%") + (f"\n{self.count} шт." if self.count is not None else "")
return f"{self.name}\nЖанр: {self.genre}\nИздатель: {self.publisher}\n" + (str(self.price) if self.discount is None else f"{math.ceil(float(cleaned_string) * (100 - self.discount) / 100)},00 ₽ -{self.discount}%") + (f"\n{self.count} шт." if self.count is not None else "")