diff --git a/flanabot/bots/btc_offers_bot.py b/flanabot/bots/btc_offers_bot.py index 2d114fa..d0b5603 100644 --- a/flanabot/bots/btc_offers_bot.py +++ b/flanabot/bots/btc_offers_bot.py @@ -140,12 +140,13 @@ class BtcOffersBot(MultiBot, ABC): f'\n {payment_method}' for payment_method in offer['payment_methods'] ) + rounded_premium = round(offer['premium'], 2) offer_parts.extend( ( f"Cantidad: {offer['amount']}", f"Precio (EUR): {offer['price_eur']:.2f} €", f"Precio (USD): {offer['price_usd']:.2f} $", - f"Prima: {offer['premium']:.2f} %", + f"Prima: {rounded_premium if rounded_premium else '0.00'} %", f'Métodos de pago:{payment_methods_text}' ) ) @@ -235,7 +236,8 @@ class BtcOffersBot(MultiBot, ABC): case {'max_price_usd': max_price_usd}: response_text = f'✅ ¡Perfecto! Te avisaré cuando existan ofertas por {max_price_usd:.2f} $ o menos.' case _: - response_text = f"✅ ¡Perfecto! Te avisaré cuando existan ofertas con una prima del {query['max_premium']:.2f} % o menor." + rounded_max_premium = round(query['max_premium'], 2) + response_text = f"✅ ¡Perfecto! Te avisaré cuando existan ofertas con una prima del {rounded_max_premium if rounded_max_premium else '0.00'} % o menor." await self.send(response_text, message) await self.start_btc_offers_notification(message.chat, query)