libbase/memtest: Print size with 1 digit after the decimal point.

This commit is contained in:
Florent Kermarrec 2021-05-27 19:33:29 +02:00
parent 9b85769499
commit d11dc0b503
1 changed files with 3 additions and 3 deletions

View File

@ -165,11 +165,11 @@ static void print_size(unsigned long size) {
if (size < KIB) if (size < KIB)
printf("%luB", size); printf("%luB", size);
else if (size < MIB) else if (size < MIB)
printf("%luKiB", size/KIB); printf("%lu.%luKiB", size/KIB, (size/1 - KIB*(size/KIB))/(KIB/10));
else if (size < GIB) else if (size < GIB)
printf("%luMiB", size/MIB); printf("%lu.%luMiB", size/MIB, (size/KIB - KIB*(size/MIB))/(KIB/10));
else else
printf("%luGiB", size/GIB); printf("%lu.%luGiB", size/GIB, (size/MIB - KIB*(size/GIB))/(KIB/10));
} }
static void print_speed(unsigned long speed) { static void print_speed(unsigned long speed) {