Происходило доп. умножение ddg при 3 аргументах, а нужно было умножать только при coniapi

This commit is contained in:
Данил 2023-06-01 13:04:26 +03:00
parent 6f364be57f
commit 36bd104438
No known key found for this signature in database
GPG key ID: 5051BCD5AB064A7B

View file

@ -131,7 +131,7 @@ class CurrencyConverter:
) )
data: Dict[str, Any] = resp.json() data: Dict[str, Any] = resp.json()
self.conv_amount = float(data.get('rate', 0)) self.conv_amount = float(data.get('rate', 0)*self.amount)
@dp.inline_handler() @dp.inline_handler()
@ -161,7 +161,7 @@ async def currency(inline_query: InlineQuery) -> None:
result = ( result = (
f'{conv.amount} {conv.from_currency} = ' f'{conv.amount} {conv.from_currency} = '
f'{math.floor(conv.conv_amount*conv.amount)} {conv.conv_currency}' f'{math.floor(conv.conv_amount)} {conv.conv_currency}'
) )
except Exception as ex: except Exception as ex: