Fix for PHP notice when given an integer degrees in decimalDegreesToDMS(); using math instead of string manipulation to split integer portion from decimal remainder.

This commit is contained in:
Brion Vibber 2010-06-28 14:41:33 -04:00
parent 53f14ddde6
commit b2ad8ec571

View File

@ -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);