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:
parent
3ec36336c1
commit
244a7670e7
@ -52,6 +52,9 @@ QString Format::distance(qreal value, Units units)
|
|||||||
if (value < MIINM)
|
if (value < MIINM)
|
||||||
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
|
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||||
+ qApp->translate("Format", "ft");
|
+ qApp->translate("Format", "ft");
|
||||||
|
else if (value < 10 * MIINM)
|
||||||
|
return l.toString(value * M2MI, 'f', 2) + UNIT_SPACE
|
||||||
|
+ qApp->translate("Format", "mi");
|
||||||
else
|
else
|
||||||
return l.toString(value * M2MI, 'f', 1) + UNIT_SPACE
|
return l.toString(value * M2MI, 'f', 1) + UNIT_SPACE
|
||||||
+ qApp->translate("Format", "mi");
|
+ qApp->translate("Format", "mi");
|
||||||
@ -59,6 +62,9 @@ QString Format::distance(qreal value, Units units)
|
|||||||
if (value < NMIINM)
|
if (value < NMIINM)
|
||||||
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
|
return l.toString(value * M2FT, 'f', 0) + UNIT_SPACE
|
||||||
+ qApp->translate("Format", "ft");
|
+ qApp->translate("Format", "ft");
|
||||||
|
else if (value < 10 * NMIINM)
|
||||||
|
return l.toString(value * M2NMI, 'f', 2) + UNIT_SPACE
|
||||||
|
+ qApp->translate("Format", "nmi");
|
||||||
else
|
else
|
||||||
return l.toString(value * M2NMI, 'f', 1) + UNIT_SPACE
|
return l.toString(value * M2NMI, 'f', 1) + UNIT_SPACE
|
||||||
+ qApp->translate("Format", "nmi");
|
+ qApp->translate("Format", "nmi");
|
||||||
@ -66,6 +72,9 @@ QString Format::distance(qreal value, Units units)
|
|||||||
if (value < KMINM)
|
if (value < KMINM)
|
||||||
return l.toString(value, 'f', 0) + UNIT_SPACE
|
return l.toString(value, 'f', 0) + UNIT_SPACE
|
||||||
+ qApp->translate("Format", "m");
|
+ qApp->translate("Format", "m");
|
||||||
|
else if (value < 10 * KMINM)
|
||||||
|
return l.toString(value * M2KM, 'f', 2) + UNIT_SPACE
|
||||||
|
+ qApp->translate("Format", "km");
|
||||||
else
|
else
|
||||||
return l.toString(value * M2KM, 'f', 1) + UNIT_SPACE
|
return l.toString(value * M2KM, 'f', 1) + UNIT_SPACE
|
||||||
+ qApp->translate("Format", "km");
|
+ qApp->translate("Format", "km");
|
||||||
|
Loading…
Reference in New Issue
Block a user