diff options
author | Henrik Brautaset Aronsen <subsurface@henrik.synth.no> | 2013-05-14 13:53:07 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-14 09:26:45 -0400 |
commit | a55a2e5d88c2e822f64e36b96910632b37ba8d6d (patch) | |
tree | 16a8e6403a80a682ba55218feb0f19907a56787d /qt-ui | |
parent | c5590f835aba2cd4d0b622b0c63ec4f5796d9548 (diff) | |
download | subsurface-a55a2e5d88c2e822f64e36b96910632b37ba8d6d.tar.gz |
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 <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/models.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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; } |