
Originally Posted by
wysota
speed = (length*percentage_completed) / time_elapsed
division used here (/) is a floating point operator.
different.
double can go to .arg(22.22) or accept .arg float as double?
not run....
QString str = QString("speed Kb/s: %1").arg(d, 0, 'f', 0);
How can .arg() print only 2 decimal??
QChar & fillChar 0
double d = 12.34;
// str == "delta: 1.234E+01"
double d = 12.34;
QString str = QString("delta: %1").arg(d, 0, 'E', 3);
// str == "delta: 1.234E+01"
To copy to clipboard, switch view to plain text mode
Bookmarks