I would like to format the integer in QString. I would always like to have 6 rooms. For example, “1” should be “000001” and “12” should be “000012”.
I am trying to do with help printf(%06d, number). Therefore i wrote this
QString test;
test = QString("%06d").arg(QString::number(i));
qDebug()<<test;
i is implemented in a loop for. But this did not work, since I have:
"0d" "1d" "2d" "3d" ...
Does anyone know how to do this, please?
source
share