Есть обменник кроптовалют. И при вводе количества допустим 0,00123 выходит ошибка
File "C:\Users\adminkropal\Desktop\kropal\make_bot_great_again.py", line 612, in exchange_wallet
res = calculator(float(message.text), data.get('currency'), "RUB")
Я так понял что у меня только настроено на 0.00123 с "." а нужно сделать что-бы было "," - запятую.
Вот код
@dp.message_handler(state=ExchangeForm.amount, content_types=types.ContentTypes.TEXT)
async def exchange_wallet(message: types.Message, state: FSMContext):
data = await state.get_data()
res = calculator(float(message.text), data.get('currency'), "RUB")
string = "0,666"
string = string.replace(",", ".")
Только проверку осуществите на наличие ",
"