From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.help Subject: Re: Converting an Integer into Human Readable String Date: Thu, 7 Apr 2011 13:34:32 +0200 Message-ID: References: <4fa1ed35-b35b-4c8d-bfca-d7fae8da913b@glegroupsg2000goo.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1302176128 5758 80.91.229.12 (7 Apr 2011 11:35:28 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 7 Apr 2011 11:35:28 +0000 (UTC) Cc: help-gnu-emacs@gnu.org, =?ISO-8859-1?Q?Nordl=F6w?= To: gnu.emacs.help@googlegroups.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 07 13:35:22 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 1Q7nUe-0007Gp-1G for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 13:35:20 +0200 Original-Received: from localhost ([127.0.0.1]:47995 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7nUd-0005UF-ED for geh-help-gnu-emacs@m.gmane.org; Thu, 07 Apr 2011 07:35:19 -0400 Original-Received: from [140.186.70.92] (port=41429 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q7nUE-0005P7-2P for help-gnu-emacs@gnu.org; Thu, 07 Apr 2011 07:34:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q7nUD-0007nV-3K for help-gnu-emacs@gnu.org; Thu, 07 Apr 2011 07:34:54 -0400 Original-Received: from mail-iy0-f169.google.com ([209.85.210.169]:65081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q7nUC-0007n7-Vq for help-gnu-emacs@gnu.org; Thu, 07 Apr 2011 07:34:53 -0400 Original-Received: by iyf13 with SMTP id 13so3194819iyf.0 for ; Thu, 07 Apr 2011 04:34:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=BbTze44G4PNKzxCwvfNEyeOnGy19mcueZkuBeiJoD2Q=; b=fmFzAtuQYNFifr7bw9qSlxGMvh/M1ITu1yqgR1Y7cNQpQ+kyh52e+b241fm18xcdSy OidlBZS0PkXT3okijA2wpHf2r/IafQC+bb9TthPraKcreoh21YEuLfnYYYZsU0ccOs7q dB9SWmvL7lx/H5GLCcWksPGWJAw4TuuEq0FYc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=TXVxDZrn1MrowFNLHwLfO9KCBk5JxiN8rwvllCxunH84418P6VXWFxgHiXKOVOOMhb 9FC+WOLzS9CcqVgO6YIjTHtaQTRt0JDlezpdqXbJMu+Ae0zsIX8ode/K9r11fG0kYugr bKINb6AFdcjFBU681A/2JcZPU5IPv6eVv+4Ks= Original-Received: by 10.231.33.205 with SMTP id i13mr778748ibd.54.1302176092173; Thu, 07 Apr 2011 04:34:52 -0700 (PDT) Original-Received: by 10.231.208.71 with HTTP; Thu, 7 Apr 2011 04:34:32 -0700 (PDT) In-Reply-To: <4fa1ed35-b35b-4c8d-bfca-d7fae8da913b@glegroupsg2000goo.googlegroups.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.210.169 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:80655 Archived-At: 2011/4/7 Nordl=F6w : > I looking for the function that prints file size on the mode-line in size= -indication-mode. I have searched for size-indication-mode in the source bu= t cannot find a code-references to it. So where is the function that prints= for example > > 22k > > when file is approximately 22 kilobytes big? > > What about difference between > - kilobytes (kB), 1000 bytes, and > - kibibytes (KiB), 1024 bytes, as defined at > > Shouldn't Emacs support both? > > This is of course not that hard to write but reinvent the wheel? > > http://en.wikipedia.org/wiki/Kibibyte > I believe what you're looking for can be found in bindings.el (L375) and an explanation of the format string %I in the documentation of mode-line-format. Where the actual "translation" takes place is still a mystery to me. --=20 Deniz Dogan