Fix time string formating

This commit is contained in:
Aurélie Delhaie
2022-10-17 20:03:12 +02:00
parent fd4b766c4d
commit 5515112404
6 changed files with 39 additions and 19 deletions

View File

@@ -30,17 +30,5 @@ void WeekOption::set_time_delta(int value)
void WeekOption::compute()
{
int m = this->time_delta;
int h = 0;
while (m > 59) {
h++;
m -= 60;
}
QString minutes = "";
if (m >= 10) {
minutes = QString::number(m, 'g', 2);
} else {
minutes = QString("0%1").arg(QString::number(m, 'g', 2));
}
ui->total_label->setText(QString("%1h%2").arg(QString::number(h, 'g', 2), minutes));
ui->total_label->setText(Tools::int_to_string_time(this->time_delta));
}