mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +00:00
Improve readabiliy.
This commit is contained in:
parent
e51f6597ed
commit
7b36bb025a
@ -587,6 +587,7 @@ Module.register("currentweather", {
|
|||||||
*/
|
*/
|
||||||
roundValue: function (temperature) {
|
roundValue: function (temperature) {
|
||||||
var decimals = this.config.roundTemp ? 0 : 1;
|
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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -181,7 +181,8 @@ 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(Math.abs(temperature) < 0.5 && this.config.roundTemp ? 0 : temperature).toFixed(decimals);
|
var roundValue = parseFloat(temperature).toFixed(decimals);
|
||||||
|
return roundValue === "-0" ? 0 : roundValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
addFilters() {
|
addFilters() {
|
||||||
|
@ -463,7 +463,8 @@ Module.register("weatherforecast", {
|
|||||||
*/
|
*/
|
||||||
roundValue: function (temperature) {
|
roundValue: function (temperature) {
|
||||||
var decimals = this.config.roundTemp ? 0 : 1;
|
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)
|
/* processRain(forecast, allForecasts)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user