Page 1 of 1

My Saratoga template sometimes doesn't work

Posted: Mon Apr 13, 2026 3:40 pm
by meteogm
Hi, please help me,
unfortunately sometimes the Saratoga template of my site at the address: https://meteogm.altervista.org/mb/wxindex.php is not readable, it does not work, and the following error appears:

Fatal error: Uncaught TypeError: round(): Argument #1 ($num) must be of type int|float, string given in /membri/meteogm/mb/MB-defs.php:63 Stack trace: #0 /membri/meteogm/mb/MB-defs.php(63): round('--', 0) #1 /membri/meteogm/mb/MBtags.php(729): include_once('/membri/meteogm...') #2 /membri/meteogm/mb/top.php(81): include_once('/membri/meteogm...') #3 /membri/meteogm/mb/wxindex.php(38): include('/membri/meteogm...') #4 {main} thrown in /membri/meteogm/mb/MB-defs.php on line 63

can you tell me why and tell me what I should do to always display it? Thanks for the reply.

Re: My Saratoga template sometimes doesn't work

Posted: Mon Apr 13, 2026 5:54 pm
by wvdkuil
Line 63 in mb/MB-defs.php now reads

Code: Select all

$windchnodp  = round($windch,0); // calculated value  
As you can see in the error message $windch contents is '--'

Code: Select all

#0 /membri/meteogm/mb/MB-defs.php(63): round('--', 0)
The $windch item is set in line 61 which reads

Code: Select all

$windch = $WX['wind0chill-act'];
Change that line 61 to

Code: Select all

$windch = (float) $WX['wind0chill-act'];
That way a '--' "value" is replaced with 0

These problems can occur when your Metobridge is not receiving the outside weather=station data
The missing values are placed with '--' values by default.