From e7b786d79a24756472739b6b0f9d46218e812b8e Mon Sep 17 00:00:00 2001 From: Kevin Lyles Date: Tue, 19 Feb 2008 03:33:12 +0000 Subject: [PATCH] Fixed round_to_int to handle negative numbers properly git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky1@1000 7f574dfc-610e-0410-a909-a81674777703 --- src/common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common.c b/src/common.c index ae1db7c..9001178 100644 --- a/src/common.c +++ b/src/common.c @@ -289,5 +289,9 @@ void update_stuff() int round_to_int(float f) { - return (int) (f + 0.5); + if (f >= 0.0) { + return (int) (f + 0.5); + } else { + return (int) (f - 0.5); + } } -- 1.7.9.5