Re: [PATCH] change throughput display units with fast links
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Oct 14, 2009, 07:07 UTC
- Message-ID
- <4AD578BD.7080201@viscovery.net>
- In-Reply-To
- <alpine.LFD.2.00.0910132256280.20122@xanadu.home>
Nicolas Pitre schrieb:
> + if (rate > 1 << 10) {
> + int x = rate + 5; /* for rounding */
> + snprintf(tp->display + sizeof(tp->display) - l, l,
> + " | %u.%2.2u MiB/s",Shouldn't the fractional part be "%02.2u" (leading zeros instead of blanks)?
Show 5 quoted lines
> + x >> 10, ((x & ((1 << 10) - 1)) * 100) >> 10); > + } else if (rate) > snprintf(tp->display + sizeof(tp->display) - l, l, > " | %u KiB/s", rate); > }
-- Hannes