From d410b6f1500cc84d2ff13d886c508a47aeff6545 Mon Sep 17 00:00:00 2001 From: David Greenman Date: Fri, 5 Aug 1994 10:34:19 +0000 Subject: [PATCH] Changed output formatting to accurately represent the precision. --- sbin/ping/ping.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 46db1ca1b6af..222b95440e70 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -523,7 +523,7 @@ pr_pack(buf, cc, from) icp->icmp_seq); (void)printf(" ttl=%d", ip->ip_ttl); if (timing) - (void)printf(" time=%g ms", triptime); + (void)printf(" time=%.3f ms", triptime); if (dupflag) (void)printf(" (DUP!)"); /* check the data */ @@ -712,7 +712,7 @@ finish() if (nreceived && timing) { /* Only display average to microseconds */ i = 1000.0 * tsum / (nreceived + nrepeats); - (void)printf("round-trip min/avg/max = %g/%g/%g ms\n", + (void)printf("round-trip min/avg/max = %.3f/%.3f/%.3f ms\n", tmin, ((double)i) / 1000.0, tmax); } exit(0);