(num_bytes: Union[int, float])
| 568 | |
| 569 | @enforce_types |
| 570 | def printable_filesize(num_bytes: Union[int, float]) -> str: |
| 571 | for count in ['Bytes','KB','MB','GB']: |
| 572 | if num_bytes > -1024.0 and num_bytes < 1024.0: |
| 573 | return '%3.1f %s' % (num_bytes, count) |
| 574 | num_bytes /= 1024.0 |
| 575 | return '%3.1f %s' % (num_bytes, 'TB') |
| 576 | |
| 577 | |
| 578 | @enforce_types |
no outgoing calls
no test coverage detected