diff --git a/UI_V2/pages/home/home.py b/UI_V2/pages/home/home.py index 3b166b6..c733c16 100644 --- a/UI_V2/pages/home/home.py +++ b/UI_V2/pages/home/home.py @@ -463,8 +463,12 @@ class Home: def add_products(self, products): for product in products: + try: + price = f"{round(float(product['price']) - float(product['price'])*float(product['discount'])/100,2)}" + except: + price = '' self.new_price = ft.Text( - value=f"{round(float(product['price']) - float(product['price'])*float(product['discount'])/100,2)}", + value= price, size=14 if product['discount'] != 0 else 12, color=ft.Colors.RED if product['discount'] != 0 else ft.Colors.BLACK, weight=ft.FontWeight.BOLD