From 9588c9c00bda6041a39bd4a05ab6d4d40921eb67 Mon Sep 17 00:00:00 2001 From: Sascha Riemer Date: Mon, 27 Aug 2018 19:19:05 +0200 Subject: [PATCH] Change GPX decimal separator to dot --- src/FileIO/GpxRideFile.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/FileIO/GpxRideFile.cpp b/src/FileIO/GpxRideFile.cpp index a42300512..2f0560d5e 100644 --- a/src/FileIO/GpxRideFile.cpp +++ b/src/FileIO/GpxRideFile.cpp @@ -83,12 +83,16 @@ GpxFileReader::toByteArray(Context *, const RideFile *ride, bool withAlt, bool w QDomElement trkseg = doc.createElement("trkseg"); trk.appendChild(trkseg); + QLocale cLocale(QLocale::Language::C); + foreach (const RideFilePoint *point, ride->dataPoints()) { QDomElement trkpt = doc.createElement("trkpt"); trkseg.appendChild(trkpt); - trkpt.setAttribute("lat", point->lat); - trkpt.setAttribute("lon", point->lon); + QString strLat = cLocale.toString(point->lat, 'g', 12); + trkpt.setAttribute("lat", strLat); + QString strLon = cLocale.toString(point->lon, 'g', 12); + trkpt.setAttribute("lon", strLon); // GPX standard requires , if present, to be first if (withAlt && ride->areDataPresent()->alt) {