help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Converting an Integer into Human Readable String


From: Eli Zaretskii
Subject: Re: Converting an Integer into Human Readable String
Date: Thu, 07 Apr 2011 21:44:22 +0300

> From: "Drew Adams" <address@hidden>
> Date: Thu, 7 Apr 2011 11:13:07 -0700
> 
> In any case, what I wrote was incorrect.  AFAICT there is no way to pass the
> number that is to be interpreted as the buffer size by "%I", except by passing
> an actual BUFFER of the given size as arg.  This will do it, I guess, but it
> seems a bit silly:

Yes, but this isn't:

  (ls-lisp-format-file-size 4060 t) => "   4k"

Of course, on Posix platforms you will need to (require 'ls-lisp)
first, which is undesirable.  Hmm...

It would make sense to extract the workhorse of
ls-lisp-format-file-size and make it a separate function in subr.el.
Patches welcome.



reply via email to

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