From ca6d521a0a5d22f4bbb1c6c4b6146dad03fa5584 Mon Sep 17 00:00:00 2001 From: FreeBear Date: Tue, 21 May 2024 13:14:58 +0100 Subject: [PATCH] Missing the FILE_SIZE_DIVIDER for gigabits - This results in the number being printed with the decimal point in the wrong place. --- src/hasp/hasp_parser.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hasp/hasp_parser.cpp b/src/hasp/hasp_parser.cpp index a44a9741..eee1175d 100644 --- a/src/hasp/hasp_parser.cpp +++ b/src/hasp/hasp_parser.cpp @@ -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); }