currentweather, weatherforecast, changed option of decimal comma to any decimal symbol

This commit is contained in:
Torben Tigges
2017-12-31 01:15:59 +01:00
parent 46c0e14d67
commit df0515cebf
5 changed files with 45 additions and 29 deletions

View File

@@ -24,7 +24,7 @@ Module.register("currentweather",{
showWindDirectionAsArrow: false,
useBeaufort: true,
lang: config.language,
decimalComma: false,
decimalSymbol: ".",
showHumidity: false,
degreeLabel: false,
showIndoorTemperature: false,
@@ -210,14 +210,13 @@ Module.register("currentweather",{
}
}
if (this.config.decimalSymbol === "") {
this.config.decimalSymbol = ".";
}
var temperature = document.createElement("span");
temperature.className = "bright";
if (this.config.decimalComma) {
temperature.innerHTML = " " + this.temperature.replace(".",",") + "°" + degreeLabel;
}
else {
temperature.innerHTML = " " + this.temperature + "°" + degreeLabel;
}
temperature.innerHTML = " " + this.temperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
large.appendChild(temperature);
if (this.config.showIndoorTemperature && this.indoorTemperature) {
@@ -227,12 +226,7 @@ Module.register("currentweather",{
var indoorTemperatureElem = document.createElement("span");
indoorTemperatureElem.className = "bright";
if (this.config.decimalComma) {
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".",",") + "°" + degreeLabel;
}
else {
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature + "°" + degreeLabel;
}
indoorTemperatureElem.innerHTML = " " + this.indoorTemperature.replace(".", this.config.decimalSymbol) + "°" + degreeLabel;
large.appendChild(indoorTemperatureElem);
}