RE: [PATCH v2 1/3] eal: add function rte_size_to_str

2025-03-11 Thread Morten Brørup
> + return snprintf(buf, buf_size, "%.*f%c%s", precision, > + (double)count / powi, *prefix, use_iec ? "i" : ""); I prefer a space between the number and the postfix (if a postfix is present), e.g. "1.23 M", so when followed by the unit, it becomes "1.23 Mbit/s" rather th

Re: [PATCH v2 1/3] eal: add function rte_size_to_str

2025-03-11 Thread Bruce Richardson
On Tue, Mar 11, 2025 at 08:49:05AM -0700, Stephen Hemminger wrote: > On Tue, 11 Mar 2025 08:33:13 -0700 > Andre Muezerie wrote: > > > It's common to use %' in the printf format specifier to make large numbers > > more easily readable by having the thousands grouped. However, this > > grouping doe

[PATCH v2 1/3] eal: add function rte_size_to_str

2025-03-11 Thread Andre Muezerie
It's common to use %' in the printf format specifier to make large numbers more easily readable by having the thousands grouped. However, this grouping does not work on Windows. Therefore, a function is needed to make uint64_t numbers more easily readable. There are at least two tests that can bene