Subject: [PATCH] [iputils] Print packet loss with more precision

From: Alexander Graf <[email-masked]>
Date: Tue, 7 Aug 2007 15:49:50 +0200

Signed-off-by: Alexander Graf <[email-masked]>
---
 ping_common.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/ping_common.c b/ping_common.c
index 83be553..49acab2 100644
--- a/ping_common.c
+++ b/ping_common.c
@@ -795,9 +795,9 @@ void finish(void)
 	if (nerrors)
 		printf(", +%ld errors", nerrors);
 	if (ntransmitted) {
-		printf(", %d%% packet loss",
-		       (int) ((((long long)(ntransmitted - nreceived)) * 100) /
-			      ntransmitted));
+		printf(", %f%% packet loss",
+		       (((long long)(ntransmitted - nreceived)) * 100.0) /
+			      ntransmitted);
 		printf(", time %ldms", 1000*tv.tv_sec+tv.tv_usec/1000);
 	}
 	putchar('\n');
-- 
1.5.2.4