summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-08 20:51:13 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-08 21:00:56 -0700
commitbbe62f756a0c0fbfae58c40d9e1605382c0f65a6 (patch)
tree058b2fcb72bdab56ab1ddee6c4edf1c259c08021 /profile.c
parent11380a5deb071b647e10dbd51e64340e50da801d (diff)
downloadsubsurface-bbe62f756a0c0fbfae58c40d9e1605382c0f65a6.tar.gz
Change character for liter in SAC values as well
And fix the bug that in the info overlay SAC was always given in metric values. And try to reduce the number of places in which we calculate the unit conversions... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/profile.c b/profile.c
index 38e19a07d..db7a101f6 100644
--- a/profile.c
+++ b/profile.c
@@ -1230,7 +1230,9 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me
{
int pressurevalue, mod, ead, end, eadd;
const char *depth_unit, *pressure_unit, *temp_unit, *vertical_speed_unit;
- double depthvalue, tempvalue, speedvalue;
+ double depthvalue, tempvalue, speedvalue, sacvalue;
+ int decimals;
+ const char *unit;
depthvalue = get_depth_units(entry->depth, NULL, &depth_unit);
put_format(b, translate("gettextFromC", "@: %d:%02d\nD: %.1f%s\n"), FRACTION(entry->sec, 60), depthvalue, depth_unit);
@@ -1247,9 +1249,9 @@ static void plot_string(struct plot_info *pi, struct plot_data *entry, struct me
if (entry->speed > 0)
speedvalue *= -1;
put_format(b, translate("gettextFromC", "V: %.1f%s\n"), speedvalue, vertical_speed_unit);
-
+ sacvalue = get_volume_units(entry->sac, &decimals, &unit);
if (entry->sac && prefs.show_sac)
- put_format(b, translate("gettextFromC", "SAC: %2.1fl/min\n"), entry->sac / 1000.0);
+ put_format(b, translate("gettextFromC", "SAC: %.*f%s/min\n"), sacvalue, decimals, unit);
if (entry->cns)
put_format(b, translate("gettextFromC", "CNS: %u%%\n"), entry->cns);
if (prefs.pp_graphs.po2)