googlecodelabs / your-first-pwapp

Code associated with Your First Progressive Web App codelab
https://g.co/codelabs/pwa
Apache License 2.0
638 stars 555 forks source link

Fetching Deg C & kmh #141

Closed ufosolutions closed 5 years ago

ufosolutions commented 5 years ago

Thank you for a great source of information on creating a PWA.

I live in Australia and would like to find a way of displaying Deg in C and wind speed in kph.

I edited the app.js to calculate a conversion, ############################ `
//Math.round(current.temp);

Math.ceil((current.temp - 32) * 0.5555555555555556); // convert to c and use ceil

//Math.round(wind.speed); //for an approximate result, multiply the speed value by 1.609

Math.round(wind.speed * 1.609);` ############################ but really want to know how to fetch it properly. Is this possible?

petele commented 5 years ago

The API I was using only provides it in F/MPH. There may be a way to change that, but I'm not sure.