X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=f81ae7138dae8f92a91c9eb26739ef06456bd0d0;hb=18b8247cb357a9a716846854e451e306b752e542;hp=a7ea885a1200bcbaa42dcddae915565665bdd01f;hpb=43601f654675c8734c9ca5850cc41dac16d1989a;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index a7ea885..f81ae71 100644 --- a/profile.c +++ b/profile.c @@ -485,19 +485,13 @@ static int setup_temperature_limits(struct graphics_context *gc, struct plot_inf static void plot_single_temp_text(struct graphics_context *gc, int sec, int mkelvin) { - int deg; + double deg; const char *unit; static const text_render_options_t tro = {12, 0.2, 0.2, 1.0, LEFT, TOP}; - temperature_t temperature = { mkelvin }; - if (output_units.temperature == FAHRENHEIT) { - deg = to_F(temperature); - unit = UTF8_DEGREE "F"; - } else { - deg = to_C(temperature); - unit = UTF8_DEGREE "C"; - } - plot_text(gc, &tro, sec, temperature.mkelvin, "%d%s", deg, unit); + deg = get_temp_units(mkelvin, &unit); + + plot_text(gc, &tro, sec, mkelvin, "%d%s", (int)(deg + 0.5), unit); } static void plot_temperature_text(struct graphics_context *gc, struct plot_info *pi)