From bf456972b798b9668a60c17853c01ab835045a63 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Fri, 28 Aug 2015 10:40:33 +0200 Subject: [PATCH] kilobytes is the smallest unit and never has precision Signed-off-by: Christian Hesse --- Meter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Meter.c b/Meter.c index ee8fbf78..8792f93d 100644 --- a/Meter.c +++ b/Meter.c @@ -157,6 +157,9 @@ int Meter_humanUnit(char* buffer, unsigned long int value, int size) { ++prefix; } + if (*prefix == 'K') + precision = 0; + for (; precision > 0; precision--) { powj *= 10; if (value / powi < powj)