From 971e6703eb9bed936cc62cd335105bd2acca14ef Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 11 Aug 2015 16:53:34 +0200 Subject: [PATCH] lat/lng format when printing is incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Maurice-Jörg Nießen --- nmea.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nmea.c b/nmea.c index ec0a350..438de9d 100644 --- a/nmea.c +++ b/nmea.c @@ -144,8 +144,8 @@ nmea_rmc_cb(void) LOG("position: %d°%d'%.1f\" %d°%d'%.1f\"\n", latd, latm, flats, lngd, lngm, flngs); - snprintf(latitude, sizeof(latitude), "%d.%d", latd, ms_to_deg(latm, lats)); - snprintf(longitude, sizeof(longitude), "%d.%d", lngd, ms_to_deg(lngm, lngs)); + snprintf(latitude, sizeof(latitude), "%d.%04d", latd, ms_to_deg(latm, lats)); + snprintf(longitude, sizeof(longitude), "%d.%04d", lngd, ms_to_deg(lngm, lngs)); LOG("position: %s %s\n", latitude, longitude); gps_timestamp(); } -- 2.30.2