mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
Changed roundTemp implementation to a cleaner one
This commit is contained in:
@@ -182,13 +182,9 @@ Module.register("currentweather",{
|
||||
weatherIcon.className = "wi weathericon " + this.weatherType;
|
||||
large.appendChild(weatherIcon);
|
||||
|
||||
var temp = this.temperature;
|
||||
if (this.config.roundTemp) {
|
||||
temp = Math.round(temp);
|
||||
}
|
||||
var temperature = document.createElement("span");
|
||||
temperature.className = "bright";
|
||||
temperature.innerHTML = " " + temp + "°";
|
||||
temperature.innerHTML = " " + this.temperature + "°";
|
||||
large.appendChild(temperature);
|
||||
|
||||
wrapper.appendChild(large);
|
||||
@@ -436,6 +432,7 @@ Module.register("currentweather",{
|
||||
|
||||
|
||||
roundValue: function(temperature) {
|
||||
return parseFloat(temperature).toFixed(1);
|
||||
var decimals = this.config.roundTemp ? 0 : 1;
|
||||
return parseFloat(temperature).toFixed(decimals);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user