Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

size of attached files in unit bytes is shown with decimals #10594

Closed
meigelb opened this issue Apr 16, 2024 · 0 comments · Fixed by #10595
Closed

size of attached files in unit bytes is shown with decimals #10594

meigelb opened this issue Apr 16, 2024 · 0 comments · Fixed by #10595

Comments

@meigelb
Copy link
Contributor

meigelb commented Apr 16, 2024

Overview

The size of a file attached to an entry is shown in as a separate column in a list. For files with size below 1024 bytes, the size is shown in smallest unit "B" (bytes) but also displays two decimals. This is a bit misleading, since for file sizes no fractions of size exist and, hence, should not be displayed. For larger units, such as kilobytes, the decimals should be shown.
The issue is shown in the following screenshot and marked with the red box:
KeePassXC_attachment_decimal_bytes

Steps to Reproduce

  1. add a new entry to your database
  2. to this entry, add an attachment of size smaller than 1024 Bytes
  3. in the GUI, besides the "Name" also the "Size" of the attached file is shown
  4. the size is given in unit bytes denoted by "B" but shows two decimals, see screenshot above

Expected Behavior

The size of the file in bytes should be shown as integer without decimals. Only files larger than 1024 bytes, should show decimals if presented in their corresponding unit, such as kilobytes.

Actual Behavior

The size of files smaller than 1024 bytes is shown in bytes but with two decimals. But no fractions of bytes exist when it comes to file sizes.

Context

The issue occurs independent of user-selected language.

KeePassXC - 2.7.7
Revision: 68e2dd8

Operating System: Windows, but issue is independent

@meigelb meigelb added the bug label Apr 16, 2024
meigelb added a commit to meigelb/keepassxc that referenced this issue Apr 16, 2024
meigelb added a commit to meigelb/keepassxc that referenced this issue Apr 16, 2024
droidmonkey pushed a commit that referenced this issue Apr 24, 2024
pull bot pushed a commit to tigerwill90/keepassxc that referenced this issue Apr 25, 2024
pull bot pushed a commit to shashinma/keepassxc that referenced this issue Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants