Missing the FILE_SIZE_DIVIDER for gigabits - This results in the number

being printed with the decimal point in the wrong place.
This commit is contained in:
FreeBear 2024-05-21 13:14:58 +01:00
parent 8fc9ec7e17
commit ca6d521a0a

View File

@ -212,6 +212,7 @@ int Parser::format_bytes(size_t filesize, char* buf, size_t len)
return snprintf_P(buf, len, PSTR("%d" D_DECIMAL_POINT "%02d " D_FILE_SIZE_MEGABYTES), filesize / 100,
filesize % 100);
filesize = filesize / D_FILE_SIZE_DIVIDER; // multiply by 100 for 2 decimal place
return snprintf_P(buf, len, PSTR("%d" D_DECIMAL_POINT "%02d " D_FILE_SIZE_GIGABYTES), filesize / 100,
filesize % 100);
}