diff --git a/CHANGELOG.md b/CHANGELOG.md index df41689b..e0caa6de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Remove white flash on boot up. - Added `update` in Raspberry Pi installation script. - Fix an issue where the analog clock looked scrambled. ([#611](https://github.com/MichMich/MagicMirror/issues/611)) +- If units is set to imperial, the showRainAmount option of weatherforecast will show the correct unit. ## [2.1.0] - 2016-12-31 diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index 9bd15ba8..0b389873 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -150,7 +150,11 @@ Module.register("weatherforecast",{ if (isNaN(forecast.rain)) { rainCell.innerHTML = ""; } else { - rainCell.innerHTML = forecast.rain + " mm"; + if(config.units !== "imperial") { + rainCell.innerHTML = forecast.rain + " mm"; + } else { + rainCell.innerHTML = (parseFloat(forecast.rain) / 25.4).toFixed(2) + " in"; + } } rainCell.className = "align-right bright rain"; row.appendChild(rainCell);