From 5f45e886ff8e9b554d1056477ff49ba2cdddf24c Mon Sep 17 00:00:00 2001 From: martin-s Date: Sat, 5 Apr 2008 19:28:51 +0000 Subject: [PATCH] Fix:Compile fix, improved distance display git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@984 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- navit/src/osd/core/osd_core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/navit/src/osd/core/osd_core.c b/navit/src/osd/core/osd_core.c index 72c260f..40ff502 100644 --- a/navit/src/osd/core/osd_core.c +++ b/navit/src/osd/core/osd_core.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include "config.h" @@ -79,8 +80,12 @@ format_distance(char *buffer, double distance) sprintf(buffer,"%.1f km", distance/1000); else if (distance >= 300) sprintf(buffer,"%.0f m", round(distance/25)*25); - else + else if (distance >= 50) sprintf(buffer,"%.0f m", round(distance/10)*10); + else if (distance >= 10) + sprintf(buffer,"%.0f m", distance); + else + sprintf(buffer,"%.1f m", distance); } static void -- 2.7.4