From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: Floating-point formatting string Date: Tue, 13 Feb 2007 20:36:05 -0500 Message-ID: <87mz3hy0ze.fsf@stupidchicken.com> References: <45D2630F.70105@ig.com.br> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1171416996 14562 80.91.229.12 (14 Feb 2007 01:36:36 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Feb 2007 01:36:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Vinicius Jose Latorre Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 14 02:36:30 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HH94Q-0006en-2c for ged-emacs-devel@m.gmane.org; Wed, 14 Feb 2007 02:36:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HH94P-0006tw-H2 for ged-emacs-devel@m.gmane.org; Tue, 13 Feb 2007 20:36:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HH94E-0006tA-5y for emacs-devel@gnu.org; Tue, 13 Feb 2007 20:36:18 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HH94C-0006st-T2 for emacs-devel@gnu.org; Tue, 13 Feb 2007 20:36:16 -0500 Original-Received: from south-station-annex.mit.edu ([18.72.1.2]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HH94C-0003QF-FB for emacs-devel@gnu.org; Tue, 13 Feb 2007 20:36:16 -0500 Original-Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by south-station-annex.mit.edu (8.13.6/8.9.2) with ESMTP id l1E1aEVF024738; Tue, 13 Feb 2007 20:36:15 -0500 (EST) Original-Received: from outgoing-legacy.mit.edu (OUTGOING-LEGACY.MIT.EDU [18.7.22.104]) by central-city-carrier-station.mit.edu (8.13.6/8.9.2) with ESMTP id l1E1a71s019811; Tue, 13 Feb 2007 20:36:07 -0500 (EST) Original-Received: from localhost (SYDNEYPACIFIC-FIVE-NINETY-NINE.MIT.EDU [18.95.7.88]) ) by outgoing-legacy.mit.edu (8.13.6/8.12.4) with ESMTP id l1E1a6jm026211; Tue, 13 Feb 2007 20:36:06 -0500 (EST) Original-Received: from cyd by localhost with local (Exim 3.36 #1 (Debian)) id 1HH942-0000bw-00; Tue, 13 Feb 2007 20:36:06 -0500 In-Reply-To: <45D2630F.70105@ig.com.br> (Vinicius Jose Latorre's message of "Tue\, 13 Feb 2007 23\:17\:03 -0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-Scanned-By: MIMEDefang 2.42 X-Spam-Score: 0.001 X-detected-kernel: Solaris 9.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:66358 Archived-At: Vinicius Jose Latorre writes: > Hi, > > > It seems that there is a problem with floating-point formatting string > in Emacs 22. > > Type > M-: (format "%03.3f" 1.2) RET > ==> "1.200" > > Shouldn't it be "001.200"? The Elisp manual says, of the width specification: If the printed representation of the object contains fewer characters than this width, then it is padded. In this case, the 03 refers to the width of the entire string "1.200", which is 5 > 3. For example, M-: (format "%08.3f" 1.2) ==> 0001.200