This change prevents returning '-0' (negative zero) when roundTemp is true.

This commit is contained in:
drewski3420@gmail.com 2020-12-30 09:03:19 -05:00
parent e80a65a3cd
commit e51f6597ed

View File

@ -181,7 +181,7 @@ Module.register("weather", {
roundValue: function (temperature) { roundValue: function (temperature) {
var decimals = this.config.roundTemp ? 0 : 1; 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);
}, },
addFilters() { addFilters() {