Skip to content

Commit e930451

Browse files
committed
Merge pull request #10 from olafmandel/ISSUE-9
Send double parameters with full precision
2 parents f8b87f0 + 6c99164 commit e930451

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

maiaObject.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828

2929
#include "maiaObject.h"
30+
#include <cfloat>
3031

3132
MaiaObject::MaiaObject(QObject* parent) : QObject(parent){
3233
QDomImplementation::setInvalidDataPolicy(QDomImplementation::DropInvalidChars);
@@ -63,7 +64,7 @@ QDomElement MaiaObject::toXml(QVariant arg) {
6364
} case QVariant::Double: {
6465

6566
QDomElement tagDouble = doc.createElement("double");
66-
QDomText textDouble = doc.createTextNode(QString::number(arg.toDouble()));
67+
QDomText textDouble = doc.createTextNode(QString::number(arg.toDouble(), 'g', DBL_DIG));
6768

6869
tagValue.appendChild(tagDouble);
6970
tagDouble.appendChild(textDouble);

0 commit comments

Comments
 (0)