| 1 |
function wunderground_English()
|
| 2 |
{
|
| 3 |
if (document.getElementById("temp")) { document.getElementById("temp").innerHTML = temp_f + " F"; }
|
| 4 |
if (document.getElementById("pressure")) { document.getElementById("pressure").innerHTML = pressure_in + "\""; }
|
| 5 |
if (document.getElementById("dewpoint")) { document.getElementById("dewpoint").innerHTML = dewpoint_f + " F"; }
|
| 6 |
if (document.getElementById("wind")) { document.getElementById("wind").innerHTML = wind_dir + " @ " + wind_mph + " MPH"; }
|
| 7 |
if (document.getElementById("gusts")) { document.getElementById("gusts").innerHTML = wind_gust_mph + " MPH"; }
|
| 8 |
if (document.getElementById("precip")) { document.getElementById("precip").innerHTML = precip_in + "\" today"; }
|
| 9 |
|
| 10 |
return;
|
| 11 |
}
|
| 12 |
|
| 13 |
function wunderground_Metric()
|
| 14 |
{
|
| 15 |
if (document.getElementById("temp")) { document.getElementById("temp").innerHTML = (Math.round((temp_f - 32) * (5/9) * 100)/100) + " C"; }
|
| 16 |
if (document.getElementById("pressure")) { document.getElementById("pressure").innerHTML = (Math.round(pressure_in * 33.8637526 * 100)/100) + " mb"; }
|
| 17 |
if (document.getElementById("dewpoint")) { document.getElementById("dewpoint").innerHTML = (Math.round((dewpoint_f - 32) * (5/9) * 100)/100) + " C"; }
|
| 18 |
if (document.getElementById("wind")) { document.getElementById("wind").innerHTML = wind_dir + " @ " + (Math.round(wind_mph * 1.609344 * 100)/100) + " km/h"; }
|
| 19 |
if (document.getElementById("gusts")) { document.getElementById("gusts").innerHTML = (Math.round(wind_gust_mph * 1.609344 * 100)/100) + " km/h"; }
|
| 20 |
if (document.getElementById("precip")) { document.getElementById("precip").innerHTML = (Math.round(precip_in * 25.4 * 100)/100) + " mm today"; }
|
| 21 |
|
| 22 |
return;
|
| 23 |
}
|
| 24 |
|
| 25 |
if (units == "Metric") {
|
| 26 |
wunderground_Metric();
|
| 27 |
}
|
| 28 |
else {
|
| 29 |
wunderground_English();
|
| 30 |
}
|