Как добавить к float числу символ $
У меня есть файл pricebitcoin.py
import requests
from bs4 import BeautifulSoup
import time
class Currency:
url = 'юрл'
headers = {
'User-Agent': 'юзер агент'}
diferent = 1
compare_currency = 0
# init
def __init__(self):
self.compare_currency = float(self.get_currency())
# get currency bitcoin
def get_currency(self):
full_page = requests.get(self.url, headers=self.headers)
soup = BeautifulSoup(full_page.content, 'html.parser')
convert = soup.findAll(
"span", {"class": "DFlfde SwHCTb"})
priceformat = (convert[0].text).replace(",", "")
return priceformat
который выводит цену биткоина. Также есть файл bot.py
import logging
from aiogram import Bot, Dispatcher, executor, types
import config
import pricebitcoin
curen = pricebitcoin.Currency()
# Объект бота
bot = Bot(config.token)
# Диспетчер для бота
dp = Dispatcher(bot)
# Включаем логирование, чтобы не пропустить важные сообщения
logging.basicConfig(level=logging.INFO)
# Хэндлер на команду /price
@dp.message_handler(commands="price")
async def priceb(message: types.Message):
await message.answer(curen.get_currency())
if __name__ == "__main__":
# Запуск бота
executor.start_polling(dp, skip_updates=True)
через который запускается объект из файла pricebitcoin.py, а также выводит цену по команде /price. Но он выводит цену в типе float без символа $. Я уже пытался как-то его добавить, но ничего не получилось