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:
parent
53f14ddde6
commit
b2ad8ec571
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user