From a55a2e5d88c2e822f64e36b96910632b37ba8d6d Mon Sep 17 00:00:00 2001 From: Henrik Brautaset Aronsen Date: Tue, 14 May 2013 13:53:07 +0200 Subject: Don't add half a kilo/pound when adding weights The weight management widget added 500 grams / 0.5 lbs when a new entry was added. Signed-off-by: Henrik Brautaset Aronsen Signed-off-by: Dirk Hohndel --- qt-ui/models.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index 4c45f1489..9bc8db0bb 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -167,9 +167,9 @@ QVariant WeightModel::data(const QModelIndex& index, int role) const if (get_units()->weight == units::KG) { int gr = ws->weight.grams % 1000; int kg = ws->weight.grams / 1000; - ret = QString("%1.%2").arg(kg).arg((unsigned)(gr + 500) / 100); + ret = QString("%1.%2").arg(kg).arg((unsigned) gr / 100); } else { - ret = QString("%1").arg((unsigned)(grams_to_lbs(ws->weight.grams) + 0.5)); + ret = QString("%1").arg((unsigned)(grams_to_lbs(ws->weight.grams))); } break; } -- cgit v1.2.3-70-g09d2