Naga raju Naga raju -4 years ago 349
C++ Question

convert double to QString

I am writing one program in QT. I want to convert double into Qstring in cpp.

Please help me.


Answer Source

Use QString's number method (docs are here):

double valueAsDouble = 1.2;
QString valueAsString = QString::number(valueAsDouble);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download