parent
71aaba799b
commit
5d2001d369
12
js/level2.js
12
js/level2.js
|
@ -165,16 +165,14 @@ function loadWeather() {
|
||||||
|
|
||||||
function formatTemp( temperature ) {
|
function formatTemp( temperature ) {
|
||||||
|
|
||||||
temperature = ( temperature ).toFixed(1);
|
temperature = temperature - 273.15; // K to C
|
||||||
|
|
||||||
|
temperature = ( temperature ).toFixed(1); // 1 decimal
|
||||||
|
|
||||||
if (temperature > 10 ) {
|
if (temperature > 10 ) {
|
||||||
|
temperature = Math.round( temperature ); // round up to the nearest integer
|
||||||
temperature = Math.round( temperature );
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return temperature + '°C';
|
||||||
return temperature + '°';
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function OWMIcon( imageCode ) {
|
function OWMIcon( imageCode ) {
|
||||||
|
|
Loading…
Reference in New Issue