Commit 7d3dc1d0 authored by Zac Wood's avatar Zac Wood
Browse files

rounded precipitation probability

parent 8c334e77
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<h1 class="mdl-card__title-text"><a href="{{weatherData.alerts.url}}">{{weatherData.alerts.title}}</a> until {{formatTimestamp weatherData.alerts.expires}}<br /></h1> <h1 class="mdl-card__title-text"><a href="{{weatherData.alerts.url}}">{{weatherData.alerts.title}}</a> until {{formatTimestamp weatherData.alerts.expires}}<br /></h1>
</div> </div>
<div class="mdl-card__supporting-text"> <div class="mdl-card__supporting-text">
{{waatherData.alerts.description}} {{weatherData.alerts.description}}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -7,7 +7,7 @@ Template.weather.helpers({ ...@@ -7,7 +7,7 @@ Template.weather.helpers({
//Convert precipitation percentage to words //Convert precipitation percentage to words
precipitationWords: function(rawPrecipProb) { precipitationWords: function(rawPrecipProb) {
weatherDataDependency.depend(); weatherDataDependency.depend();
var precipProb = rawPrecipProb * 100; var precipProb = Math.round(rawPrecipProb * 100);
if(weatherData === undefined) return "..."; if(weatherData === undefined) return "...";
if(precipProb === 0) return "No Precipitation"; if(precipProb === 0) return "No Precipitation";
if(precipProb >= 90) return "Bring an Umbrella ("+precipProb+"% chance)"; if(precipProb >= 90) return "Bring an Umbrella ("+precipProb+"% chance)";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment