From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: Converting an Integer into Human Readable String Date: Thu, 07 Apr 2011 21:01:31 +0200 Message-ID: <87sjttc2d0.fsf@gmail.com> References: <4fa1ed35-b35b-4c8d-bfca-d7fae8da913b@glegroupsg2000goo.googlegroups.com> <71350401EC6C46958001611853D0D855@us.oracle.com> <834o6aufdl.fsf@gnu.org> <8F4245F3ABA84D459CF61965581C8F31@us.oracle.com> <83zko1ucjd.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1302203282 18165 80.91.229.12 (7 Apr 2011 19:08:02 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2011 19:08:02 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 07 21:07:57 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q7uYf-0006HR-IG for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 21:07:57 +0200 Original-Received: from localhost ([127.0.0.1]:47387 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7uTm-0000oX-1d for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 15:02:54 -0400 Original-Received: from [140.186.70.92] (port=45680 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7uT7-0000dR-TO for help-gnu-emacs@gnu.org; Thu, 07 Apr 2011 15:02:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7uSk-0005te-CJ for help-gnu-emacs@gnu.org; Thu, 07 Apr 2011 15:01:51 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:46418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7uSk-0005tP-6h for help-gnu-emacs@gnu.org; Thu, 07 Apr 2011 15:01:50 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Q7uSh-0002IL-Nr for help-gnu-emacs@gnu.org; Thu, 07 Apr 2011 21:01:47 +0200 Original-Received: from 221.77.197-77.rev.gaoland.net ([77.197.77.221]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Apr 2011 21:01:47 +0200 Original-Received: from thierry.volpiatto by 221.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Apr 2011 21:01:47 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 221.77.197-77.rev.gaoland.net User-Agent: Gnus/5.110016 (No Gnus v0.16) Emacs/23.3.50 (gnu/linux) Cancel-Lock: sha1:3bfAr+BUv3946Ofr0dhjaKzKtP8= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80679 Archived-At: Eli Zaretskii writes: >> From: "Drew Adams" >> 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. anything have a function for this: (anything-ff-human-size 4060) ==> "4.0K" -- A+ Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997