mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Use the same conversion grams->lbs in dive and equipment list
Subsurface stores weight values in grams. When displaying lbs, the dive list was not rounding the converted weights up, but rather truncating the value at the decimal place. The equipment list was rounding the converted weights up. This gave two different displayed values for the same weight value. Signed-off-by: Benjamin Fogel <nystire@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
c28fe00bfe
commit
9961cf13b1
2 changed files with 5 additions and 3 deletions
|
@ -1114,7 +1114,8 @@ QString DiveItem::displayWeight() const
|
|||
int kg = weight() / 1000;
|
||||
str = QString("%1.%2").arg(kg).arg((unsigned)(gr) / 100);
|
||||
} else {
|
||||
str = QString("%1").arg((unsigned)(grams_to_lbs(weight())));
|
||||
double lbs = grams_to_lbs(weight());
|
||||
str = QString("%1").arg(lbs, 0, 'f', lbs >= 40.0 ? 0 : 1 );
|
||||
}
|
||||
|
||||
return str;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue