From 606269fcc1913a87ce963e9efb768d08fe8e2d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 1 Feb 2022 23:55:27 +0100 Subject: [PATCH] Use a sane precision for speed/bearing --- src/GUI/motioninfoitem.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/GUI/motioninfoitem.cpp b/src/GUI/motioninfoitem.cpp index 094a9c14..45e87365 100644 --- a/src/GUI/motioninfoitem.cpp +++ b/src/GUI/motioninfoitem.cpp @@ -83,29 +83,29 @@ void MotionInfoItem::setDigitalZoom(qreal zoom) QString MotionInfoItem::speed(const QLocale &l) const { if (_units == Nautical) - return l.toString(MS2KN * _speed) + UNIT_SPACE + return l.toString(MS2KN * _speed, 'f', 1) + UNIT_SPACE + qApp->translate("MotionInfoItem", "kn"); else if (_units == Imperial) - return l.toString(MS2MIH * _speed) + UNIT_SPACE + return l.toString(MS2MIH * _speed, 'f', 1) + UNIT_SPACE + qApp->translate("MotionInfoItem", "mi/h"); else - return l.toString(MS2KMH * _speed) + UNIT_SPACE + return l.toString(MS2KMH * _speed, 'f', 1) + UNIT_SPACE + qApp->translate("MotionInfoItem", "km/h"); } QString MotionInfoItem::verticalSpeed(const QLocale &l) const { if (_units == Nautical || _units == Imperial) - return l.toString(MS2FTMIN * _verticalSpeed) + UNIT_SPACE + return l.toString(MS2FTMIN * _verticalSpeed, 'f', 1) + UNIT_SPACE + qApp->translate("MotionInfoItem", "ft/min"); else - return l.toString(MS2MMIN * _verticalSpeed) + UNIT_SPACE + return l.toString(MS2MMIN * _verticalSpeed, 'f', 1) + UNIT_SPACE + qApp->translate("MotionInfoItem", "m/min"); } static QString bearing(qreal val, const QLocale &l) { - return l.toString(val) + DEGREE_UNIT; + return l.toString(val, 'f', 0) + DEGREE_UNIT; } QString MotionInfoItem::text() const