Welcome to the Cumulus Support forum.

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

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.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

wxuvforecast.php discrepancy with home page

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
david3
Posts: 63
Joined: Sat 28 Jan 2012 4:03 pm
Weather Station: Davis Vantage Vue
Operating System: Debian 12 64bit for rpi

wxuvforecast.php discrepancy with home page

Post by david3 »

I noticed that the UV strength (Low, Medium, High, Very High, Extreme) was sometimes different on the home page vs. the wxuvforecast.php page.

For example, the main page would say:

Code: Select all

UV Index Forecast     UV Index Forecast
   12/02/2014            12/03/2014
   7.6 High              7.2 High
But the wxuvforecast page would say:

Code: Select all

   Tue         Wed
   7.6         7.2
Very High      High
I think the difference is that the wxuvforecast page is rounding the numerical forecast values instead of truncating them. The 7.6 gets rounded to 8, which is considered "Very High" whereas the main page gets it as "7" which is "High".

I just changed the wxuvforecast.php script to truncate the values instead of rounding them, and that seems to fix it for me. This was the change I made:

Code: Select all

107c107
<           <td align="center"><?php echo get_uv_word(round($UVfcstUVI[$i],0)); ?></td>
---
>           <td align="center"><?php echo get_uv_word(floor($UVfcstUVI[$i])); ?></td>
129c129
<       $ourUVrounded = round($uv,0);
---
>       $ourUVrounded = floor($uv);
Post Reply