
Originally Posted by
marc2050
I've a number y = 0.62354642
When I try
QString("%1").arg(y)
It does not show on my screen the full 0.62354642.
Rather is shows the value of '1'.
Then the value y is 1 (or within a small margin of it) not 0.62354642. Have you done an integer operation/assignment somewhere? Or have just left out the percent sign in the QString template?
double y1 = 0.62354642;
float y2 = 0.62354642;
double y1 = 0.62354642;
float y2 = 0.62354642;
qDebug() << QString("%1").arg(y1) << QString::number(y1, 'g', 8) ;
qDebug() << QString("%1").arg(y2) << QString::number(y2, 'g', 8) ;
To copy to clipboard, switch view to plain text mode
outputs:
"0.623546" "0.62354642"
"0.623546" "0.62354642"
"0.623546" "0.62354642"
"0.623546" "0.62354642"
To copy to clipboard, switch view to plain text mode
Bookmarks