You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, March 11th 2005, 10:16pm

converting float to qstring?

Is there any method in QT to convert a float to a QString?

The purpose is to take a sum of a column (within a QTable)
and then setText() the total into the bottom cell of the column.

Its easy enough to convert the contents of the cell from text
to a float with the toFloat() function but I can't seem to see
any way to perform the reverse.

Any help appreciated.

jacek

Master

  • "jacek" is male

Posts: 2,729

Location: Warsaw, Poland

  • Send private message

2

Friday, March 11th 2005, 10:34pm

RE: converting float to qstring?

QString::number

Posts: 2,162

Location: Graz, Austria

Occupation: Student

  • Send private message

3

Saturday, March 12th 2005, 3:13pm

Or QString::sprintf

Cheers,
_
Qt/KDE Developer
Debian User