Merge pull request #737 from FreeBear-nc/bugfixes

Missing the FILE_SIZE_DIVIDER for gigabits
This commit is contained in:
fvanroie 2024-05-21 15:08:21 +02:00 committed by GitHub
commit 9254fac675
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);
}