From 06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Sep 2011 02:11:55 +0300 Subject: Add more checks and some code cleanups. --- src/units.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/units.cpp') diff --git a/src/units.cpp b/src/units.cpp index db9faadd1..edf9c749a 100644 --- a/src/units.cpp +++ b/src/units.cpp @@ -208,8 +208,10 @@ std::string formatUnit(int value, int type) ul = ud.levels[i]; if (ul.count) + { nextAmount = levelAmount / ul.count; - levelAmount %= ul.count; + levelAmount %= ul.count; + } if (levelAmount > 0) output = strprintf("%d%s", levelAmount, pl.symbol.c_str()) + output; -- cgit v1.2.3-70-g09d2