mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Don't show a SAC of 0.0l/min (or cuft/min)
When we have no data about the gas consumption it makes no sense to show a SAC of 0. Instead we should show either "unknown" or nothing. Fixes #693 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
eb63ccfed5
commit
74e7b8e879
2 changed files with 21 additions and 9 deletions
|
@ -1263,10 +1263,13 @@ QString DiveItem::displaySac() const
|
|||
{
|
||||
QString str;
|
||||
struct dive *dive = get_dive_by_uniq_id(diveId);
|
||||
const char *unit;
|
||||
int decimal;
|
||||
double value = get_volume_units(dive->sac, &decimal, &unit);
|
||||
return QString::number(value, 'f', decimal).append(unit).append(tr("/min"));
|
||||
if (dive->sac) {
|
||||
const char *unit;
|
||||
int decimal;
|
||||
double value = get_volume_units(dive->sac, &decimal, &unit);
|
||||
return QString::number(value, 'f', decimal).append(unit).append(tr("/min"));
|
||||
}
|
||||
return QString("");
|
||||
}
|
||||
|
||||
QString DiveItem::displayWeight() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue