NoRulez
7th July 2010, 13:24
Hi @all,
i have a QLineEdit and want the text converted to a double, so I do:
lineEdit->setText("123456789");
QVariant val = lineEdit->text().toDouble();
qDebug() << val;
.
.
.
lineEdit2->setText(val.toString());
Now the output would be: QVariant(double, 1.23457e+08)
And also the value in lineEdit2 is "1.23457e+08"
How can I avoid the exponentials?
Thanks in advance
Best Regards
NoRulez
i have a QLineEdit and want the text converted to a double, so I do:
lineEdit->setText("123456789");
QVariant val = lineEdit->text().toDouble();
qDebug() << val;
.
.
.
lineEdit2->setText(val.toString());
Now the output would be: QVariant(double, 1.23457e+08)
And also the value in lineEdit2 is "1.23457e+08"
How can I avoid the exponentials?
Thanks in advance
Best Regards
NoRulez