Quote Originally Posted by rajesh View Post
ToddAtWSU,
do you mean this:

double time = 1.3333;
QString str = QString("%04.2f").arg(time );

in this case str storing 1.3333.2f as I checked in Qt4.3.1

or
str = QString("%04.2f").arg(time); also not giving correct result

so, what is the syntax?
Sorry I meant

Qt Code:
  1. char str[16];
  2. sprintf( str, "%04.2f", number ); // I believe this is correct using sprintf
  3. QString str = QString(str);
To copy to clipboard, switch view to plain text mode 

But I see you got the answer.