mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-10 03:42:09 +08:00
drive_stats.cc: fix distance rounding
old-commit-hash: 32330bbf8930bf20ef9ef2c54682faa5c30eff6c
This commit is contained in:
@@ -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)));
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user