summaryrefslogtreecommitdiffstats
path: root/save-html.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-17 17:25:44 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-17 17:25:44 -0700
commitb39e478c57745c1b546152cc45cd28cb701aaa83 (patch)
treeed2a95a85175fc88f6b220303727c52c230081e4 /save-html.c
parent9f5207fc0dbef71839438e02426e481d06c2c03c (diff)
downloadsubsurface-b39e478c57745c1b546152cc45cd28cb701aaa83.tar.gz
HTML export: corretly show weird imperial tank sizes
It's not enough to convert the wet volume - you need to multiply in the working pressure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-html.c')
-rw-r--r--save-html.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/save-html.c b/save-html.c
index d15ac962f..5e5f931c5 100644
--- a/save-html.c
+++ b/save-html.c
@@ -121,7 +121,10 @@ static void put_cylinder_HTML(struct membuffer *b, struct dive *dive)
separator = ", ";
write_attribute(b, "Type", cylinder->type.description, ", ");
if (cylinder->type.size.mliter) {
- put_HTML_volume_units(b, cylinder->type.size.mliter, "\"Size\":\"", " \", ");
+ int volume = cylinder->type.size.mliter;
+ if (prefs.units.volume == CUFT && cylinder->type.workingpressure.mbar)
+ volume *= bar_to_atm(cylinder->type.workingpressure.mbar / 1000.0);
+ put_HTML_volume_units(b, volume, "\"Size\":\"", " \", ");
} else {
write_attribute(b, "Size", "--", ", ");
}