summaryrefslogtreecommitdiffstats
path: root/sbin/ping
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1994-08-05 10:34:19 +0000
committerdg <dg@FreeBSD.org>1994-08-05 10:34:19 +0000
commit44d9b495233affd6592a98a3bfe1d30646a38440 (patch)
treebbc8448fe2cece9a0fa8c12bd016951e37817a28 /sbin/ping
parent8b4c1e13e09010c46d5beea0d87d7a6acbf7ec54 (diff)
downloadFreeBSD-src-44d9b495233affd6592a98a3bfe1d30646a38440.zip
FreeBSD-src-44d9b495233affd6592a98a3bfe1d30646a38440.tar.gz
Changed output formatting to accurately represent the precision.
Diffstat (limited to 'sbin/ping')
-rw-r--r--sbin/ping/ping.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c
index 46db1ca..222b954 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);
OpenPOWER on IntegriCloud