Rounding bug for large files
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 :
- [x] Bug in existing feature
colorls: 1.4.6 zsh: 5.9 os: arch
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 https://github.com/athityakumar/colorls/blob/24e402c153274dc5b9cde89ad6235ac5a4746129/lib/colorls/core.rb#L283
I want to pick it up @avdv
I want to pick it up @avdv
Sure, thank you!
@avdv I have raised the PR: https://github.com/athityakumar/colorls/pull/622