MCPcopy
hub / github.com/borgbackup/borg / format_file_size

Function format_file_size

src/borg/helpers/parseformat.py:426–429  ·  view source on GitHub ↗

Format file size into a human friendly format

(v, precision=2, sign=False, iec=False)

Source from the content-addressed store, hash-verified

424
425
426def format_file_size(v, precision=2, sign=False, iec=False):
427 """Format file size into a human friendly format"""
428 fn = sizeof_fmt_iec if iec else sizeof_fmt_decimal
429 return fn(v, suffix="B", sep=" ", precision=precision, sign=sign)
430
431
432class FileSize(int):

Callers 15

__exit__Method · 0.85
log_instrumentationMethod · 0.85
check_free_spaceMethod · 0.85
__exit__Method · 0.85
log_instrumentationMethod · 0.85
osize_fmtMethod · 0.85
usize_fmtMethod · 0.85
sig_info_handlerMethod · 0.85
__format__Method · 0.85
format_contentMethod · 0.85
report_and_deleteMethod · 0.85

Calls

no outgoing calls

Tested by 4

test_file_sizeFunction · 0.68
test_file_size_iecFunction · 0.68
test_file_size_precisionFunction · 0.68
test_file_size_signFunction · 0.68