From e80a65a3cd6edba0e198b4ef4a9722f27cc45bdb Mon Sep 17 00:00:00 2001 From: "drewski3420@gmail.com" Date: Wed, 30 Dec 2020 08:51:07 -0500 Subject: [PATCH] This change prevents returning '-0' (negative zero) when roundTemp is true --- modules/default/weatherforecast/weatherforecast.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 4ecc18aa..09431966 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -463,7 +463,7 @@ Module.register("weatherforecast", { */ roundValue: function (temperature) { var decimals = this.config.roundTemp ? 0 : 1; - return parseFloat(temperature).toFixed(decimals); + return parseFloat(Math.abs(temperature) < 0.5 && this.config.roundTemp ? 0 : temperature).toFixed(decimals); }, /* processRain(forecast, allForecasts)