...
x = x + zkx;
y = y + zky;
Z = sqrt(pow(xx - x, 2) + pow(yy - y, 2));
}
ui->answer->addItem(QString::fromStdString("x: " + std::to_string(x) + " y: " + std::to_string(y)));
}
double x = 12.3456789;
double y = 98.7654321;
QString str = QString("x: %1 y: %2").arg(x, 0, 'f', 3).arg(y, 0, 'f', 3);
OUT:
x: 12.346 y: 98.765