Skip to content

Issue with Conversions #8

@trrisner

Description

@trrisner

with updated php(s), the string * float or string * int equations won't work.
You have to convert all strings like wind speed or temperature to a float or an int to get the conversions to work.
Otherwise it kicks out to a fatal error.

Change
$windspeed = round(2.23694 * $this->result['wind_speed']); // convert m/s to mi/h
to
$windspeed = round(2.23694 * (float)$this->result['wind_speed']); // convert m/s to mi/h

AND

return round($conversion_factor * $speed, 2);
to
return round((float)$conversion_factor * (float)$speed, 2);

and all other occurrences in the script to get the code to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions