drive_stats.cc: fix distance rounding
parent
0ce3792a15
commit
32330bbf89
|
@ -32,7 +32,7 @@ void DriveStats::parseResponse(QString response) {
|
|||
|
||||
auto update = [](const QJsonObject &obj, StatsLabels& labels, bool metric) {
|
||||
labels.routes->setText(QString::number((int)obj["routes"].toDouble()));
|
||||
labels.distance->setText(QString::number(obj["distance"].toDouble() * (metric ? MILE_TO_KM : 1)));
|
||||
labels.distance->setText(QString::number(int(obj["distance"].toDouble() * (metric ? MILE_TO_KM : 1))));
|
||||
labels.hours->setText(QString::number((int)(obj["minutes"].toDouble() / 60)));
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue