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

Rounding bug for large files #600

Open
1 task done
draptik opened this issue Sep 29, 2023 · 1 comment
Open
1 task done

Rounding bug for large files #600

draptik opened this issue Sep 29, 2023 · 1 comment

Comments

@draptik
Copy link

draptik commented Sep 29, 2023

Files larger than 1GB are rounded wrong?

Example:

~/Downloads
❯ colorls -l *img
   rw-r--r--   1   patrick   patrick      1 GiB   Fri Sep 29 20:42:49 2023    2023-05-03-raspios-bullseye-arm64-lite.img
   rw-r--r--   1   patrick   patrick      1 GiB   Fri Sep 29 20:41:50 2023    2023-05-03-raspios-bullseye-armhf-lite.img

~/Downloads
❯ ls -alh *img
-rw-r--r-- 1 patrick patrick 2.0G Sep 29 20:42 2023-05-03-raspios-bullseye-arm64-lite.img
-rw-r--r-- 1 patrick patrick 1.9G Sep 29 20:41 2023-05-03-raspios-bullseye-armhf-lite.img

~/Downloads
❯ ls -al *img
-rw-r--r-- 1 patrick patrick 2101346304 Sep 29 20:42 2023-05-03-raspios-bullseye-arm64-lite.img
-rw-r--r-- 1 patrick patrick 1967128576 Sep 29 20:41 2023-05-03-raspios-bullseye-armhf-lite.img

Both files are more 2GB-like, than 1GB-like.

  • Type of issue :
    • Bug in existing feature

colorls: 1.4.6
zsh: 5.9
os: arch

@avdv
Copy link
Collaborator

avdv commented Nov 6, 2023

Thank you for raising this issue. I can confirm this is a problem in our code, we always cut off the 3 rightmost characters (internally the size is formatted with 2 digits after the decimal point) here

size_num = size[0][0..-4].rjust(chars_for_size, ' ')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants