QString str = "1234.56";double val = str.toDouble(); qDebug()<<val; // val == 1234.56QString str = "21234.56";double val = str.toDouble(); qDebug()<<val; // val == 21234.6QString str = "221234.56";double val = str.toDouble(); qDebug()<<val; // val == 221234
double val = 21234.56;qDebug() << val;
newItem = new QTableWidgetItem(QString::number(val));
str = QString("%L1").arg(val,0,'f',2);newItem = new QTableWidgetItem(str);