Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Corey Sheldon
weather
Commits
7d3dc1d0
Commit
7d3dc1d0
authored
May 23, 2017
by
Zac Wood
Browse files
rounded precipitation probability
parent
8c334e77
Changes
2
Hide whitespace changes
Inline
Side-by-side
weather/client/views/weather/weather.html
View file @
7d3dc1d0
...
...
@@ -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>
</div>
<div
class=
"mdl-card__supporting-text"
>
{{w
a
atherData.alerts.description}}
{{w
e
atherData.alerts.description}}
</div>
</div>
</div>
...
...
weather/client/views/weather/weather.js
View file @
7d3dc1d0
...
...
@@ -7,7 +7,7 @@ Template.weather.helpers({
//Convert precipitation percentage to words
precipitationWords
:
function
(
rawPrecipProb
)
{
weatherDataDependency
.
depend
();
var
precipProb
=
rawPrecipProb
*
100
;
var
precipProb
=
Math
.
round
(
rawPrecipProb
*
100
)
;
if
(
weatherData
===
undefined
)
return
"
...
"
;
if
(
precipProb
===
0
)
return
"
No Precipitation
"
;
if
(
precipProb
>=
90
)
return
"
Bring an Umbrella (
"
+
precipProb
+
"
% chance)
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment