mirror of https://github.com/borgbackup/borg.git
revert 0-formatting to be compatible with previous behaviour
as we format differences (growing/shrinking) we want: -N # negative / shrinking 0 # no change -> no +/- sign here! +N # positive / growing
This commit is contained in:
parent
831448684c
commit
87e3b699c0
|
@ -271,7 +271,7 @@ def parse_file_size(s):
|
|||
|
||||
|
||||
def sizeof_fmt(num, suffix='B', units=None, power=None, sep='', precision=2, sign=False):
|
||||
sign = '+' if sign else ''
|
||||
sign = '+' if sign and num > 0 else ''
|
||||
fmt = '{0:{1}.{2}f}{3}{4}{5}'
|
||||
prec = 0
|
||||
for unit in units[:-1]:
|
||||
|
|
|
@ -579,7 +579,7 @@ def test_file_size_precision():
|
|||
|
||||
def test_file_size_sign():
|
||||
si_size_map = {
|
||||
0: '+0 B',
|
||||
0: '0 B',
|
||||
1: '+1 B',
|
||||
1234: '+1.23 kB',
|
||||
-1: '-1 B',
|
||||
|
|
Loading…
Reference in New Issue