diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 18a65855..815b0653 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -587,6 +587,7 @@ Module.register("currentweather", { */ roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; - return parseFloat(Math.abs(temperature) < 0.5 && this.config.roundTemp ? 0 : temperature).toFixed(decimals); + var roundValue = parseFloat(temperature).toFixed(decimals); + return roundValue === "-0" ? 0 : roundValue; } }); diff --git a/modules/default/weather/weather.js b/modules/default/weather/weather.js index 51f80ff1..c045804c 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -181,7 +181,8 @@ Module.register("weather", { roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; - return parseFloat(Math.abs(temperature) < 0.5 && this.config.roundTemp ? 0 : temperature).toFixed(decimals); + var roundValue = parseFloat(temperature).toFixed(decimals); + return roundValue === "-0" ? 0 : roundValue; }, addFilters() { diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 09431966..1d0e16f3 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -463,7 +463,8 @@ Module.register("weatherforecast", { */ roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; - return parseFloat(Math.abs(temperature) < 0.5 && this.config.roundTemp ? 0 : temperature).toFixed(decimals); + var roundValue = parseFloat(temperature).toFixed(decimals); + return roundValue === "-0" ? 0 : roundValue; }, /* processRain(forecast, allForecasts)