var h = new Object();
+ var trans = {
+ "Wind" : function (speed) { return (speed * 2.236936).toFixed(1); },
+ "Wind_1m" : function (speed) { return (speed * 2.236936).toFixed(1); },
+ "Wind_Max": function (speed) { return (speed * 2.236936).toFixed(1); }
+ };
+
+
function do_debug(text) {
document.getElementById("do_debug").innerHTML = text;
}
function fill_html(key,value) {
var d = document.getElementById(key);
if (d !== null) {
- d.innerHTML = value;
+ var f = trans[key];
+ if (f && typeof(f) === "function") {
+ d.innerHTML = trans[key](value);
+ } else {
+ d.innerHTML = value;
+ }
}
}
<th>Humidity:</th><td> <span id="Humidity_Out"> </span> %</td>
<th>Dew Point:</th><td> <span id="Dew_Point"> </span> °C</td>
</tr>
- <tr><th>Wind:</th><td><span id="Dir"> </span> ° @ <span id="Wind"> </span> m/s</td>
- <th>Wind Minute Avg:</th><td> <span id="Dir_1m"> </span> ° @ <span id="Wind_1m"> </span> m/s </td>
- <th>Day Max Speed:</th><td> <span id="Wind_Max"> </span> m/s @ <span id="Wind_Max_T"> </span></td>
+ <tr><th>Wind:</th><td><span id="Dir"> </span> ° @ <span id="Wind"> </span> mph</td>
+ <th>Wind Minute Avg:</th><td> <span id="Dir_1m"> </span> ° @ <span id="Wind_1m"> </span> mph </td>
+ <th>Day Max Speed:</th><td> <span id="Wind_Max"> </span> mph @ <span id="Wind_Max_T"> </span></td>
</tr>
<tr>
<th>Rain 30mins:</th><td> <span id="Rain_1h"> </span> mm</td>