From 67c1b1158becc1091fbb71caf06ecd8ff957efef Mon Sep 17 00:00:00 2001 From: rinkk <karsten.rink@ufz.de> Date: Mon, 15 Jan 2018 13:51:42 +0100 Subject: [PATCH] changed write format for vector data to ensure decimal output --- GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp | 6 +++--- GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp index 4e25efb715d..f94d410c84a 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlGmlInterface.cpp @@ -283,15 +283,15 @@ bool XmlGmlInterface::write() pointTag.setAttribute("id", QString::number(i)); pointTag.setAttribute( "x", - QString::number((*(*points)[i])[0], 'g', + QString::number((*(*points)[i])[0], 'f', std::numeric_limits<double>::digits10)); pointTag.setAttribute( "y", - QString::number((*(*points)[i])[1], 'g', + QString::number((*(*points)[i])[1], 'f', std::numeric_limits<double>::digits10)); pointTag.setAttribute( "z", - QString::number((*(*points)[i])[2], 'g', + QString::number((*(*points)[i])[2], 'f', std::numeric_limits<double>::digits10)); std::string const& point_name(pnt_vec->getItemNameByID(i)); diff --git a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp index 54b13ac800f..933c4d095cc 100644 --- a/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp +++ b/GeoLib/IO/XmlIO/Qt/XmlStnInterface.cpp @@ -242,9 +242,12 @@ bool XmlStnInterface::write() QString stationType = (isBorehole) ? "borehole" : "station"; QDomElement stationTag = doc.createElement(stationType); stationTag.setAttribute( "id", QString::number(i) ); - stationTag.setAttribute( "x", QString::number((*(*stations)[i])[0], 'f') ); - stationTag.setAttribute( "y", QString::number((*(*stations)[i])[1], 'f') ); - stationTag.setAttribute( "z", QString::number((*(*stations)[i])[2], 'f') ); + stationTag.setAttribute( "x", QString::number((*(*stations)[i])[0], 'f', + std::numeric_limits<double>::digits10)); + stationTag.setAttribute( "y", QString::number((*(*stations)[i])[1], 'f', + std::numeric_limits<double>::digits10)); + stationTag.setAttribute( "z", QString::number((*(*stations)[i])[2], 'f', + std::numeric_limits<double>::digits10)); stationsTag.appendChild(stationTag); QDomElement stationNameTag = doc.createElement("name"); -- GitLab