You could also do simpler things like:

Qt Code:
  1. qDebug() << QString( "%1" ).arg( 3.14159, 8, 'f', 2 );
To copy to clipboard, switch view to plain text mode 

which will produce the same output as the first line in the previous reply.