Naga raju Naga raju - 1 year ago 141
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.

Thanks,
Nagaraju.

Answer Source

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

double valueAsDouble = 1.2;
QString valueAsString = QString::number(valueAsDouble);