mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +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.
|
||||
- Move lodash into devDependencies, update other dependencies.
|
||||
- Switch from ical to node-ical library.
|
||||
- Convert `-0` to `0` when displaying temperature.
|
||||
|
||||
### Fixed
|
||||
|
||||
|
@ -593,6 +593,7 @@ Module.register("currentweather", {
|
||||
*/
|
||||
roundValue: function (temperature) {
|
||||
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) {
|
||||
var decimals = this.config.roundTemp ? 0 : 1;
|
||||
return parseFloat(temperature).toFixed(decimals);
|
||||
var roundValue = parseFloat(temperature).toFixed(decimals);
|
||||
return roundValue === "-0" ? 0 : roundValue;
|
||||
},
|
||||
|
||||
addFilters() {
|
||||
|
@ -462,7 +462,8 @@ Module.register("weatherforecast", {
|
||||
*/
|
||||
roundValue: function (temperature) {
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user