Printable View
I want to know which solution is accepted by maverick_pol...
Quote: Originally Posted by rajesh 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 Code: char str[16];sprintf( str, "%04.2f", number ); // I believe this is correct using sprintfQString str = QString(str); But I see you got the answer.
char str[16];sprintf( str, "%04.2f", number ); // I believe this is correct using sprintfQString str = QString(str);