Hello, I would like to display a double number into a MessageBox:
if I write:
double d = 0.75;
QMessageBox::information(0,
"Time",
"Value: "+str
+".\n");
double d = 0.75;
QString str = QString("delta: %1").arg(d, 0, 'g', 6);
QMessageBox::information(0,"Time","Value: "+str+".\n");
To copy to clipboard, switch view to plain text mode
i's display ok: Value: 0.75.
But if I write:
double d = 3/4;
QMessageBox::information(0,
"Time",
"Value: "+str
+".\n");
double d = 3/4;
QString str = QString("delta: %1").arg(d, 0, 'g', 6);
QMessageBox::information(0,"Time","Value: "+str+".\n");
To copy to clipboard, switch view to plain text mode
i's display wrong: Value: 0.. Why and what I should write to display Value: 0.75?
Bookmarks