Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Apparent Temperature

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
Alan
Posts: 51
Joined: Sun 14 Mar 2010 9:41 am
Weather Station: WH1091
Operating System: Win 7
Location: Sydney

Apparent Temperature

Post by Alan »

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

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]
User avatar
mcrossley
Posts: 14388
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Apparent Temperature

Post by mcrossley »

(a-b).toFixed(1) + "C°" + "<br>" + "cooler"
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Apparent Temperature

Post by beteljuice »

You have some <td errors

typically:

<td width="100%"" align="center" <p><font size="7" ......... no closing >

eg.

<td width="100%"" align="center"> <p><font size="7"
Image
......................Imagine, what you will KNOW tomorrow !
Alan
Posts: 51
Joined: Sun 14 Mar 2010 9:41 am
Weather Station: WH1091
Operating System: Win 7
Location: Sydney

Re: Apparent Temperature

Post by Alan »

Hello Mark,
Thank you very much for your response. I tried your suggested code but unfortunately it made no difference. However, I believed that even with my limited knowledge, I could sense that something was afoot. I do not know how or why exactly, but something told me to bracket the code that you supplied... Bingo!

(a-b).toFixed(1) + "C°" + "<br>" + "cooler"
((a-b).toFixed(1) + "C°" + "<br>" + "cooler")

It now works beautifully,
Thank you ever so much for your help.
Alan
Post Reply