diff --git a/src/GUI/format.cpp b/src/GUI/format.cpp index 36ec0bce..d444883f 100644 --- a/src/GUI/format.cpp +++ b/src/GUI/format.cpp @@ -52,6 +52,9 @@ QString Format::distance(qreal value, Units units) if (value < MIINM) return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE + qApp->translate("Format", "ft"); + else if (value < 10 * MIINM) + return l.toString(value * M2MI, 'f', 2) + UNIT_SPACE + + qApp->translate("Format", "mi"); else return l.toString(value * M2MI, 'f', 1) + UNIT_SPACE + qApp->translate("Format", "mi"); @@ -59,6 +62,9 @@ QString Format::distance(qreal value, Units units) if (value < NMIINM) return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE + qApp->translate("Format", "ft"); + else if (value < 10 * NMIINM) + return l.toString(value * M2NMI, 'f', 2) + UNIT_SPACE + + qApp->translate("Format", "nmi"); else return l.toString(value * M2NMI, 'f', 1) + UNIT_SPACE + qApp->translate("Format", "nmi"); @@ -66,6 +72,9 @@ QString Format::distance(qreal value, Units units) if (value < KMINM) return l.toString(value, 'f', 0) + UNIT_SPACE + qApp->translate("Format", "m"); + else if (value < 10 * KMINM) + return l.toString(value * M2KM, 'f', 2) + UNIT_SPACE + + qApp->translate("Format", "km"); else return l.toString(value * M2KM, 'f', 1) + UNIT_SPACE + qApp->translate("Format", "km");