summaryrefslogtreecommitdiffstats
path: root/worldmap-save.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2014-05-25 08:27:48 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-25 05:39:16 -0700
commitae5c9474609a78b5989b8db26a0b0670d2e05afe (patch)
tree70e441693931ae997e7db7f25990a0da5ab6c09b /worldmap-save.c
parent8f17caeedcf6c39530e72411a28ec53a4ecd330e (diff)
downloadsubsurface-ae5c9474609a78b5989b8db26a0b0670d2e05afe.tar.gz
Use user preferred units on worldmap export
We should use the temperature units preferred by the user when exporting dive info on Worldmap. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'worldmap-save.c')
-rw-r--r--worldmap-save.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/worldmap-save.c b/worldmap-save.c
index c223ca333..fe98e32ed 100644
--- a/worldmap-save.c
+++ b/worldmap-save.c
@@ -23,8 +23,14 @@ void put_HTML_date(struct membuffer *b, struct dive *dive)
void put_HTML_temp(struct membuffer *b, struct dive *dive)
{
- put_temperature(b, dive->airtemp, "<p>Air Temp: ", "°C</p>");
- put_temperature(b, dive->watertemp, "<p>Water Temp: ", "°C</p>");
+ const char *unit;
+ double value;
+
+ value = get_temp_units(dive->airtemp.mkelvin, &unit);
+ put_format(b, "<p>Air Temp: %.1f %s</p>", value, unit);
+
+ value = get_temp_units(dive->watertemp.mkelvin, &unit);
+ put_format(b, "<p>Water Temp: %.1f %s</p>", value, unit);
}
char *replace_char(char *str, char replace, char *replace_by)