add round for balance and less callback for tariffs

This commit is contained in:
Vladless
2025-05-25 20:34:16 +03:00
parent 64049ce9c2
commit e5d709ff64
4 changed files with 127 additions and 62 deletions
+2 -1
View File
@@ -171,7 +171,8 @@ async def get_total_referral_bonus(
result = await session.execute(
text(bonus_query), {"tg_id": referrer_tg_id, "max_levels": max_levels}
)
total_bonus = result.scalar() or 0.0
total_bonus_raw = result.scalar()
total_bonus = round(float(total_bonus_raw or 0), 2)
logger.debug(f"Получена общая сумма бонусов от рефералов: {total_bonus}")
return total_bonus