Get size in readable format
(size)
| 27 | # Ask Doubt on telegram @KingVJ01 |
| 28 | |
| 29 | def get_size(size): |
| 30 | """Get size in readable format""" |
| 31 | |
| 32 | units = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB"] |
| 33 | size = float(size) |
| 34 | i = 0 |
| 35 | while size >= 1024.0 and i < len(units): |
| 36 | i += 1 |
| 37 | size /= 1024.0 |
| 38 | return "%.2f %s" % (size, units[i]) |
| 39 | |
| 40 | # Don't Remove Credit Tg - @VJ_Bots |
| 41 | # Subscribe YouTube Channel For Amazing Bot https://youtube.com/@Tech_VJ |