Tickets
Issues
# TODO: merge this function with db_size.humanize- Id: f9eaa29d5fa1a3145c797051f0fd3f53
- Status: Open
- Initial commit: bfbcd498a91d84ee535142fe170ec21e4f94a165
- Creation date: 2015-01-24 11:34:13
- Last changed: 2015-01-24 14:43:16
- Created by: Laurent Defert
- Last changed by: Laurent Defert
- File: dbannotate/db.py
# TODO: merge this function with db_size.humanize
def sizeof_fmt(num, suffix='B'):
for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']:
if abs(num) < 1024.0:
return "%3.1f%s%s" % (num, unit, suffix)
num /= 1024.0
History
-
Changed by Laurent Defert on 2015-01-24 14:43:16 during daf3f2cdb447598e52e28b08eea9ae40e221f29f
-
File:
db.py- dbannotate/db.py