percent .2f

This commit is contained in:
BennyThink 2021-05-04 11:44:58 +08:00
parent 04fbf7cdd7
commit 41f3a66938
No known key found for this signature in database
GPG key ID: 6CD0DBDA5235D481

2
bot.py
View file

@ -27,7 +27,7 @@ bot = TelegramClient('bot', app_id, app_hash).start(bot_token=token)
async def upload_callback(current, total, chat_id, message):
msg = f'Uploading {current / total * 100}: {current}/{total}'
msg = f'Uploading {round(current / total * 100, 2)}%: {current}/{total}'
await bot.edit_message(chat_id, message, msg)