diff --git a/CHANGELOG.md b/CHANGELOG.md index b93064cd..426ffd0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -117,6 +117,7 @@ Special thanks to the following contributors: @bryanzzhu, @bugsounet, @chamakura - Cleaned up clock tests. - Move lodash into devDependencies, update other dependencies. - Switch from ical to node-ical library. +- Convert `-0` to `0` when displaying temperature. ### Fixed diff --git a/modules/default/currentweather/currentweather.js b/modules/default/currentweather/currentweather.js index 918ed460..0c12e65c 100644 --- a/modules/default/currentweather/currentweather.js +++ b/modules/default/currentweather/currentweather.js @@ -593,6 +593,7 @@ Module.register("currentweather", { */ roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; - return parseFloat(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 09c4f29a..75876a98 100644 --- a/modules/default/weather/weather.js +++ b/modules/default/weather/weather.js @@ -178,7 +178,8 @@ Module.register("weather", { roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; - return parseFloat(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 53eee5dd..8afd31f4 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -462,7 +462,8 @@ Module.register("weatherforecast", { */ roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; - return parseFloat(temperature).toFixed(decimals); + var roundValue = parseFloat(temperature).toFixed(decimals); + return roundValue === "-0" ? 0 : roundValue; }, /* processRain(forecast, allForecasts)