PDA

View Full Version : setNum() digits question



tommy
23rd January 2008, 14:43
I am using a QLabel to display a number which ia a double.


void QLabel::setNum ( double num )

I don't want so many significant digits. How do I cut the number of significant digits?
I want 1.2345678 to display as 1.23

marcel
23rd January 2008, 15:19
QString s;
s = s.setNum(1.2345678, 'g', 2);
label->setText(s);