Apparent Temperature
Posted: Wed 12 Sep 2012 5:55 am
Hello All,
I started out with what I thought was going to be a simple task. I simply wanted to incorporate into my web page a readout of the Apparent Temp expressed as xx.x C° cooler/warmer than the actual temp (ie the difference between Temp and Apptemp). Functionally it is quite ok. However, the result is a number with 16 decimal places. I am not quite sure why this might happen considering that both Temp and Apptemp are only 1 decimal place numbers. I am hoping that somebody might be able to help me with code so that the result is also a 1 decimal point number. I have spent many frustrating hours trying to fix this but all to no avail.
All the best
Alan
I started out with what I thought was going to be a simple task. I simply wanted to incorporate into my web page a readout of the Apparent Temp expressed as xx.x C° cooler/warmer than the actual temp (ie the difference between Temp and Apptemp). Functionally it is quite ok. However, the result is a number with 16 decimal places. I am not quite sure why this might happen considering that both Temp and Apptemp are only 1 decimal place numbers. I am hoping that somebody might be able to help me with code so that the result is also a 1 decimal point number. I have spent many frustrating hours trying to fix this but all to no avail.
All the best
Alan
Code: Select all
<table class="data" width="1900px" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="44%"align="right" valign="center"style="font-size:300%"style="color:#228B22"><u>Temperature, Inside</u></td>
<td width="12%"align="center"valign="center"></td>
<td width="44%"align="left"valign="center"style="font-size:300%"style="color:#228B22"><u>Temperature, Outside</u></i></td>
</tr>
<tr>
<td width="44%"align="right"valign="center"style="font-size:1500%"style="color:#228B22"><#intemp><#tempunit></td>
<td width="12%"align="center"valign="center"style="font-size:140%"style="color:#228B22"><u>Apparent Temp</u><br /><br /><p>< font size="6">
[color=#0000FF] <script type="text/javascript">
var a=<#temp>;
var b=<#apptemp>;
if(a>=b)
document.write(a-b + "C°" + "<br>" + "cooler")
if(a<b)
document.write(b-a + "C°" + "<br>" + "warmer")
</script></td> [/color]
<td width="44%"align="left"valign="center"style="font-size:1500%"style="color:#228B22"><#temp><#tempunit></td>
</tr>
</table>
[urlhttp://home.exetel.com.au/retnuh/weather/lite.htm][/url]