Commit e0d47340 authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

(ls-lisp-format-file-size): Format file size with 9 digits, not 8, to avoid

misalignment for files larger than 100MB.
parent eeb935fd
2005-11-19 Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> (tiny change)
* ls-lisp.el (ls-lisp-format-file-size): Format file size with 9
digits, not 8, to avoid misalignment for files larger than 100MB.
2005-11-19 Eli Zaretskii <eliz@gnu.org>
 
* menu-bar.el (menu-bar-describe-menu) <list-keybindings>: Mention
......
......@@ -588,11 +588,11 @@ All ls time options, namely c, t and u, are handled."
(defun ls-lisp-format-file-size (file-size human-readable)
(if (or (not human-readable)
(< file-size 1024))
(format (if (floatp file-size) " %8.0f" " %8d") file-size)
(format (if (floatp file-size) " %9.0f" " %9d") file-size)
(do ((file-size (/ file-size 1024.0) (/ file-size 1024.0))
;; kilo, mega, giga, tera, peta, exa
(post-fixes (list "k" "M" "G" "T" "P" "E") (cdr post-fixes)))
((< file-size 1024) (format " %7.0f%s" file-size (car post-fixes))))))
((< file-size 1024) (format " %8.0f%s" file-size (car post-fixes))))))
(provide 'ls-lisp)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment