Skip to content

Commit

Permalink
Merge pull request #737 from FreeBear-nc/bugfixes
Browse files Browse the repository at this point in the history
Missing the FILE_SIZE_DIVIDER for gigabits
  • Loading branch information
fvanroie committed May 21, 2024
2 parents 8fc9ec7 + ca6d521 commit 9254fac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/hasp/hasp_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 9254fac

Please sign in to comment.