summaryrefslogtreecommitdiff
path: root/src/units.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-14 02:11:55 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-14 02:11:55 +0300
commit06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20 (patch)
treec884e11767b57bfaffd0643324d146dbdfe16a8b /src/units.cpp
parentc0a5fffb45f849e224750f27fa8c3be5ac447ad6 (diff)
downloadplus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.tar.gz
plus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.tar.bz2
plus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.tar.xz
plus-06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20.zip
Add more checks and some code cleanups.
Diffstat (limited to 'src/units.cpp')
-rw-r--r--src/units.cpp4
1 files changed, 3 insertions, 1 deletions
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;