google sheets docker образ

develop
Сергей Ванюшкин 2024-02-12 23:03:28 +03:00
parent a4f8bce657
commit e0a81cf126
1 changed files with 4 additions and 1 deletions

View File

@ -42,7 +42,10 @@ class SummaryService:
discont = await self.cache.get(f"DISCONT:{str(obj.get('id'))}") discont = await self.cache.get(f"DISCONT:{str(obj.get('id'))}")
if discont is not None: if discont is not None:
discont = float(discont) try:
discont = float(discont)
except Exception:
discont = 0.0
obj['price'] = round( obj['price'] = round(
obj['price'] - (obj['price'] * discont / 100), 2 obj['price'] - (obj['price'] * discont / 100), 2
) )