-
Notifications
You must be signed in to change notification settings - Fork 388
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
Fix: rounding large files #622
Conversation
@avdv Can you please take a look here |
lib/colorls/core.rb
Outdated
@@ -280,11 +280,21 @@ def chars_for_size | |||
end | |||
|
|||
def justify_size_info(size) | |||
size_num = size[0][0..-4].rjust(chars_for_size, ' ') | |||
size_num = displayable_size_num(size[0]).rjust(chars_for_size, ' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of parsing the string after conversion, just use filesize.pretty(precision: 0)
and filesize.to_s('B', precision: 0)
respectively, in the tertiary expression in the line 263 in size_info
. Then just change this to
size_num = size[0].rjust(chars_for_size, ' ')
ronn is dead, it depends on hpricot which is also dead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @ayushpoddar! I hope you don't mind me hijacking your PR to fix CI and refactor according to my comment above.
No issues @avdv. I am glad you took over since I wasn't available for making the requested changes |
Description