Skip to content

Commit

Permalink
Rewrite get_wind_angle and rename to . Resolves Weather-Station-Softw…
Browse files Browse the repository at this point in the history
  • Loading branch information
jaz-on committed Aug 8, 2023
1 parent d04144f commit 4c884be
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions includes/traits/DataUnitConversion.php
Original file line number Diff line number Diff line change
Expand Up @@ -703,16 +703,19 @@ protected function get_reverse_illuminance($value)
}

/**
* Get the wind angle expressed in its unique unit.
*
* @param mixed $value The value of the wind angle.
* @return string The wind angle expressed in its unique unit.
* @since 1.0.0
*/
protected function get_wind_angle($value)
* Get the wind angle expressed in its unique unit.
*
* @param mixed $windAngle The value of the wind angle. (Assumed to be numeric)
* @return string The wind angle expressed in its unique unit.
* @since 1.0.0
*/
protected function get_wind_angle($windAngle)
{
$result = $value;
return sprintf('%d', round($result, 0));
if (is_numeric()) {
return sprintf('%d', round($windAngle, 0));
} else {
return 'Invalid input';
}
}

/**
Expand Down

0 comments on commit 4c884be

Please sign in to comment.