How to send the output(say average) to a lineEdit?
Hi everyone. I am new to qt programming.
I want to compute the average and display the output using a lineEdit.
I used
Quote:
ui->lineEdit->setText(QString::number(avg));
This displays the output without decimals. How to display float in lineEdit?
Thanks in advance..
Re: How to send the output(say average) to a lineEdit?
There are several overloaded QString::number() variants.
have a looks at this one:
http://doc.trolltech.com/4.6/qstring.html#number-2
Re: How to send the output(say average) to a lineEdit?
Thanks .
I got it
Quote:
ui->lineEdit->setText(QString::number(avg,'f',2));