Naga raju Naga raju - 3 months ago 31
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

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

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