mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 04:02:12 +00:00
Merge pull request #2388 from drewski3420/no_negative_zero
No negative zero
This commit is contained in:
commit
6f0f75cf27
@ -117,6 +117,7 @@ Special thanks to the following contributors: @bryanzzhu, @bugsounet, @chamakura
|
|||||||
- Cleaned up clock tests.
|
- Cleaned up clock tests.
|
||||||
- Move lodash into devDependencies, update other dependencies.
|
- Move lodash into devDependencies, update other dependencies.
|
||||||
- Switch from ical to node-ical library.
|
- Switch from ical to node-ical library.
|
||||||
|
- Convert `-0` to `0` when displaying temperature.
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -593,6 +593,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(temperature).toFixed(decimals);
|
var roundValue = parseFloat(temperature).toFixed(decimals);
|
||||||
|
return roundValue === "-0" ? 0 : roundValue;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -178,7 +178,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(temperature).toFixed(decimals);
|
var roundValue = parseFloat(temperature).toFixed(decimals);
|
||||||
|
return roundValue === "-0" ? 0 : roundValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
addFilters() {
|
addFilters() {
|
||||||
|
@ -462,7 +462,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(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