mcrossley wrote:In what circumstances would you have a negative wind speed?
Oh, yes! I never thought of that!
The code works fine, by the way!
Also, I had another peice of code:
Code: Select all
<?php $wr = $imagesDir . $wrName . $dirlabel . $wrType; // normal wind rose
$wrtext = langtransstr('Wind from') ." " . langtransstr($dirlabel);
if ( (strip_units($avgspd) + strip_units($gstspd) < 0.0 )
Which wouldn't display the $wrCalm image when the wind speed was 0.0 mph and the wind gust was 0.0 mph, so I changed the code from:
Code: Select all
<?php $wr = $imagesDir . $wrName . $dirlabel . $wrType; // normal wind rose
$wrtext = langtransstr('Wind from') ." " . langtransstr($dirlabel);
if ( (strip_units($avgspd) + strip_units($gstspd) < 0.0 )
To:
Code: Select all
<?php $wr = $imagesDir . $wrName . $dirlabel . $wrType; // normal wind rose
$wrtext = langtransstr('Wind from') ." " . langtransstr($dirlabel);
if ( (strip_units($avgspd) + strip_units($gstspd) < 0.1 )
Then, the $wrCalm image, displayed again!
