mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 00:28:42 +00:00
Fix 3498 - truncate distances for display (#3663)
For distance display, better to truncate than to round up.
This commit is contained in:
committed by
GitHub
parent
a7b08c4abf
commit
f47c3003a7
@@ -253,7 +253,11 @@ DialWindow::telemetryUpdate(const RealtimeData &rtData)
|
||||
|
||||
case RealtimeData::Distance:
|
||||
case RealtimeData::LapDistance:
|
||||
case RealtimeData::RouteDistance:
|
||||
if (!GlobalContext::context()->useMetricUnits) value *= MILES_PER_KM;
|
||||
// Default floating point rounds to nearest. For distance we'd like to not see the
|
||||
// next biggest number until we're actually there... Truncate to meter.
|
||||
value = ((double)((unsigned)(value * 1000.))) / 1000.;
|
||||
valueLabel->setText(QString("%1").arg(value, 0, 'f', 3));
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user