diff options
| author | Robert Pohlink <pohlinkzei@gmx-topmail.de> | 2016-03-04 22:44:28 +0100 |
|---|---|---|
| committer | Robert Pohlink <pohlinkzei@gmx-topmail.de> | 2016-03-04 22:44:28 +0100 |
| commit | 3f5529a8f22a38f4790808f689e466012ce01db4 (patch) | |
| tree | c39951c6ce025c6f8aefc608b318a183e9d18902 | |
| parent | 2aa0177017e346ca1e2b96a8c191bb57078c99a2 (diff) | |
| download | navit-3f5529a8f22a38f4790808f689e466012ce01db4.tar.gz | |
Change format_distance to more proper values
In metric distance, all values between 10km and 1km were printed in meters. After this change all values over 100km are printed without the fractional part, between 10km and 1km with fractional part and below that in meters as it was before.
| -rw-r--r-- | navit/osd/core/osd_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c index f2a898c22..dc1e72ea8 100644 --- a/navit/osd/core/osd_core.c +++ b/navit/osd/core/osd_core.c @@ -156,9 +156,9 @@ format_distance(double distance, char *sep, int imperial) return g_strdup_printf("%.1f%smi", distance / FEET_PER_MILE, sep); } } else { - if (distance >= 100000) + if (distance >= 10000) return g_strdup_printf("%.0f%skm", distance / 1000, sep); - else if (distance >= 10000) + else if (distance >= 1000) return g_strdup_printf("%.1f%skm", distance / 1000, sep); else if (distance >= 300) return g_strdup_printf("%.0f%sm", round(distance / 25) * 25, sep); |
