emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lis


From: Lars Ingebrigtsen
Subject: Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp
Date: Mon, 14 Feb 2022 11:48:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> So how about the patch below:
>
> diff --git a/lisp/files.el b/lisp/files.el
> index cfa1a59..7e62726 100644
> --- a/lisp/files.el
> +++ b/lisp/files.el
> @@ -1494,7 +1494,8 @@ file-size-human-readable
>                                 (or unit "B"))
>                              (concat prefix unit))))
>        (format (if (and (>= (mod file-size 1.0) 0.05)
> -                       (< (mod file-size 1.0) 0.95))
> +                       (< (mod file-size 1.0) 0.95)
> +                       (< file-size 10))

Possibly, but it's hard to tell...  perhaps a better test is whether the
printed representation is longer than 6 characters, and then precision
should be reduced.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]