Fixed temperature function

How did this even work before?
gh-pages
Guillaume RISCHARD 2014-08-31 04:00:00 +02:00
parent 71aaba799b
commit 5d2001d369
1 changed files with 5 additions and 7 deletions

View File

@ -165,16 +165,14 @@ function loadWeather() {
function formatTemp( temperature ) {
temperature = ( temperature ).toFixed(1);
temperature = temperature - 273.15; // K to C
temperature = ( temperature ).toFixed(1); // 1 decimal
if (temperature > 10 ) {
temperature = Math.round( temperature );
temperature = Math.round( temperature ); // round up to the nearest integer
}
return temperature + '°';
return temperature + '°C';
}
function OWMIcon( imageCode ) {