From ba4ceb08f8be53a88f649aa3a781132cbf39437c Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Feb 04 2016 15:20:56 +0000 Subject: Format negative sizes The size change can be a negative number. It's probably better to display the number consistently with positive values. Signed-off-by: Lubomír Sedlář --- diff --git a/compose_utils/changelog.py b/compose_utils/changelog.py index 973afe4..53e5f1e 100644 --- a/compose_utils/changelog.py +++ b/compose_utils/changelog.py @@ -18,6 +18,9 @@ from kobo.threads import ThreadPool, WorkerThread def formatsize(size): + if size < 0: + return '-' + formatsize(-size) + units = ('KiB', 'MiB', 'GiB', 'TiB') size = float(size) chosen = 'B'