You are not logged in.

#1 2012-08-21 01:07:20

nemamradfazole
Member
Registered: 2010-03-18
Posts: 40
Website

[SOLVED] Xfce weather plugin—useless temperature's floating point

Xfce4-weather-plugin 0.8.1-1 comes with a floating point in the temperature value. I use xfce4-panel positioned vertically so it's not a big text then. (And I miss the sense of it, anyway.) Here is a patch for getting rid of it (to be called as "patch -Np2 -i $srcdir/temperature.patch"):

--- src/xfce4-weather-plugin-0.8.1/panel-plugin/weather-data.c  2012-08-02 23:16:17.000000000 +0200
+++ src/xfce4-weather-plugin-0.8.1/panel-plugin/weather-data.c  2012-08-21 02:27:11.357313027 +0200
@@ -85,7 +85,7 @@
         else if (unit_system == METRIC &&
                  !strcmp(loc->temperature_unit, "fahrenheit"))
             val = (val - 32.0) * 5.0 / 9.0;
-        return g_strdup_printf("%.1f", val);
+        return g_strdup_printf("%.0f", val);
     case PRESSURE:
         if (unit_system == METRIC)
             return LOCALE_DOUBLE(loc->pressure_value, "%.1f");

Offline

Board footer

Powered by FluxBB