]> arthur.barton.de Git - bup.git/commit
helpers: use float for format_filesize()
authorJohannes Berg <johannes@sipsolutions.net>
Sun, 17 May 2020 21:45:21 +0000 (23:45 +0200)
committerRob Browning <rlb@defaultvalue.org>
Wed, 20 May 2020 06:02:40 +0000 (01:02 -0500)
commit3912ff3aa3ef75f79ccc6ec014c4a691d0e3803b
tree5a64b8f032713b9590be753d5d92753cfaaf7791
parent2c1f4acab0355b28c4f8fb9f8d0329ec6b2c2afa
helpers: use float for format_filesize()

In format_filesize(), we really do want float division,
in order to display the value correctly. For example, if
there's a file with 45200000 bytes, that should be shown
as 43.1 MB, not 43.0. Fix this by using proper float
division here, not int division.

Fixes: a5809723352c ("helpers: use // not / for division")
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py