1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 03:35:53 +01:00

Increase the distance precision for tracks < 10km/nm/nmi to two decimal digits

This commit is contained in:
Martin Tůma 2024-10-31 01:31:08 +01:00
parent 3ec36336c1
commit 244a7670e7

View File

@ -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");