[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
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, (continued)
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/12
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Stefan Monnier, 2022/02/12
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/12
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Stefan Monnier, 2022/02/12
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/13
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Lars Ingebrigtsen, 2022/02/13
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/13
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Lars Ingebrigtsen, 2022/02/13
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/13
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/13
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp,
Lars Ingebrigtsen <=
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/14
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Stefan Monnier, 2022/02/14
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Lars Ingebrigtsen, 2022/02/14
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Eli Zaretskii, 2022/02/14
- Re: master 2b97e83cc1 2/2: Fix off-by-one file size formatting in ls-lisp, Rudolf Adamkovič, 2022/02/15