mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-23 19:25:54 +01:00
Increase the distance precision for tracks < 10km/nm/nmi to two decimal digits
This commit is contained in:
parent
3ec36336c1
commit
244a7670e7
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user