3 #=======================================================================
5 # File ID: 6ac1a50e-fafa-11dd-a267-000475e441b9
8 # ©opyleft 2002– Øyvind A. Holm <sunny@sunbase.org>
9 # License: GNU General Public License, see end of file for legal stuff.
10 #=======================================================================
17 our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
20 @EXPORT = qw(&ddd_to_dms);
26 # Convert floating-point degrees into D°M'S.S" (ISO-8859-1).
27 # Necessary for import into GPSman. Based on toDMS() from
28 # gpstrans-0.39 to ensure compatibility.
32 my ($Hour, $Min, $Sec) =
36 ($ddd =~ /^\-?(\d*)(\.\d+)?$/) || return(undef);
37 length($ddd) || ($ddd = 0);
44 $ddd = ($ddd - $Hour) * 60.0;
46 $Sec = ($ddd - $Min) * 60.0;
56 $Retval = sprintf("%s%.0f\xB0%02.0f'%04.1f\"",