On Tue, Apr 07, 2026 at 08:18:06PM +0545, Shuvam Pandey wrote: > string_get_size() rounds the fractional part before formatting the > result. If that carry pushes the integer part to the unit divisor, the > value is still printed in the old unit. > > This yields outputs like "1000 kB" for 999500 bytes and "1024 KiB" for > 1048064 bytes instead of promoting them to the next unit.
What does it print for 1048575, 1048576, 1048577 respectively? (before and after your patch) All the same for numbers around 2MiB. > Renormalize the value after the carry so it is promoted before > formatting. Add KUnit coverage for the decimal and binary boundary > cases. ... > --- a/lib/tests/string_helpers_kunit.c > +++ b/lib/tests/string_helpers_kunit.c Thumb up for the test cases! -- With Best Regards, Andy Shevchenko

