add missing leading zeros to coordinate formats

This commit is contained in:
Markus Ast 2021-10-15 19:58:57 +02:00
parent c621a6891b
commit 9cc67fbc5d
No known key found for this signature in database
GPG Key ID: A24156F14E230197

View File

@ -234,10 +234,10 @@ local function loadScratchpad()
if type == "DMS" then -- Degree Minutes Seconds if type == "DMS" then -- Degree Minutes Seconds
s = math.floor(s * 100) / 100 s = math.floor(s * 100) / 100
return string.format('%s %2d°%.2d\'%2.2f"', h, g, m, s) return string.format('%s %2d°%.2d\'%05.2f"', h, g, m, s)
elseif type == "DDM" then -- Degree Decimal Minutes elseif type == "DDM" then -- Degree Decimal Minutes
s = math.floor(s / 60 * 1000) s = math.floor(s / 60 * 1000)
return string.format('%s %2d°%2d.%3.3d\'', h, g, m, s) return string.format('%s %2d°%02d.%3.3d\'', h, g, m, s)
else -- Decimal Degrees else -- Decimal Degrees
return string.format('%f',d) return string.format('%f',d)
end end