diff --git a/common/util.c b/common/util.c index 32b693a449..abaca17fe9 100644 --- a/common/util.c +++ b/common/util.c @@ -23,7 +23,8 @@ int numlen(int n) { if (n == 0) { return 1; } - return log10(abs(n)) + 1; + // Account for the '-' in negative numbers. + return log10(abs(n)) + (n > 0 ? 1 : 2); } static struct modifier_key {