We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit b2ad8ec5 authored by Brion Vibber's avatar Brion Vibber

Fix for PHP notice when given an integer degrees in decimalDegreesToDMS();...

Fix for PHP notice when given an integer degrees in decimalDegreesToDMS(); using math instead of string manipulation to split integer portion from decimal remainder.
parent 53f14ddd
......@@ -463,12 +463,14 @@ class NoticeListItem extends Widget
$this->out->elementEnd('span');
}
/**
* @param number $dec decimal degrees
* @return array split into 'deg', 'min', and 'sec'
*/
function decimalDegreesToDMS($dec)
{
$vars = explode(".",$dec);
$deg = $vars[0];
$tempma = "0.".$vars[1];
$deg = intval($dec);
$tempma = abs($dec) - abs($deg);
$tempma = $tempma * 3600;
$min = floor($tempma / 60);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment