Merge pull request #1808 from FritzJay/develop

Use config.decimalSymbol when displaying the predicted amount of rain in weatherforecast
This commit is contained in:
Michael Teeuw 2019-11-13 08:01:42 +01:00 committed by GitHub
commit 73be6c35a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -25,7 +25,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Updated
### Fixed
- Fixed issue in weatherforecast module where predicted amount of rain was not using the decimal symbol specified in config.js.
## [2.9.0] - 2019-10-01
**Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md).

View File

@ -180,9 +180,9 @@ Module.register("weatherforecast",{
rainCell.innerHTML = "";
} else {
if(config.units !== "imperial") {
rainCell.innerHTML = parseFloat(forecast.rain).toFixed(1) + " mm";
rainCell.innerHTML = parseFloat(forecast.rain).toFixed(1).replace(".", this.config.decimalSymbol) + " mm";
} else {
rainCell.innerHTML = (parseFloat(forecast.rain) / 25.4).toFixed(2) + " in";
rainCell.innerHTML = (parseFloat(forecast.rain) / 25.4).toFixed(2).replace(".", this.config.decimalSymbol) + " in";
}
}
rainCell.className = "align-right bright rain";