From 9cc67fbc5d9760a7e83d16c13a1a4b8f71f1d07b Mon Sep 17 00:00:00 2001 From: Markus Ast Date: Fri, 15 Oct 2021 19:58:57 +0200 Subject: [PATCH] add missing leading zeros to coordinate formats --- Scripts/Hooks/scratchpad-hook.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/Hooks/scratchpad-hook.lua b/Scripts/Hooks/scratchpad-hook.lua index bf6cde9..7b79403 100644 --- a/Scripts/Hooks/scratchpad-hook.lua +++ b/Scripts/Hooks/scratchpad-hook.lua @@ -234,10 +234,10 @@ local function loadScratchpad() if type == "DMS" then -- Degree Minutes Seconds 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 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 return string.format('%f',d) end