From ae5c9474609a78b5989b8db26a0b0670d2e05afe Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 25 May 2014 08:27:48 +0300 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- worldmap-save.c | 10 ++++++++-- 1 file 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, "

Air Temp: ", "°C

"); - put_temperature(b, dive->watertemp, "

Water Temp: ", "°C

"); + const char *unit; + double value; + + value = get_temp_units(dive->airtemp.mkelvin, &unit); + put_format(b, "

Air Temp: %.1f %s

", value, unit); + + value = get_temp_units(dive->watertemp.mkelvin, &unit); + put_format(b, "

Water Temp: %.1f %s

", value, unit); } char *replace_char(char *str, char replace, char *replace_by)