From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Juanma Barranquero" Newsgroups: gmane.emacs.devel Subject: Re: Floating-point formatting string Date: Wed, 14 Feb 2007 02:28:46 +0100 Message-ID: References: <45D2630F.70105@ig.com.br> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1171416555 12715 80.91.229.12 (14 Feb 2007 01:29:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Feb 2007 01:29:15 +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:29:02 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 1HH8xB-0003K5-EP for ged-emacs-devel@m.gmane.org; Wed, 14 Feb 2007 02:29:01 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HH8xA-0004Ft-Uf for ged-emacs-devel@m.gmane.org; Tue, 13 Feb 2007 20:29:00 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HH8x0-0004Fb-8q for emacs-devel@gnu.org; Tue, 13 Feb 2007 20:28:50 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HH8wy-0004Dy-Ov for emacs-devel@gnu.org; Tue, 13 Feb 2007 20:28:49 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HH8wy-0004Dh-Kt for emacs-devel@gnu.org; Tue, 13 Feb 2007 20:28:48 -0500 Original-Received: from ug-out-1314.google.com ([66.249.92.171]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HH8wy-0002HU-9M for emacs-devel@gnu.org; Tue, 13 Feb 2007 20:28:48 -0500 Original-Received: by ug-out-1314.google.com with SMTP id j3so25208ugf for ; Tue, 13 Feb 2007 17:28:47 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=Pv2cPamS4L6rttRQvN7a4k8FS+Befscgnm5BlcYX2EollmTmT1PbD3WGgC+47LUiJ1mKw4WgFJX1X5yDAuaaZ44siiP0HLuUEUP5LlJ6Gm+3X5xAvX+VP2F/U39h196FL1Da1upqH6y+D2Rob5kcvlkRelrDTh9OIkm1nLA4Z0c= Original-Received: by 10.114.204.3 with SMTP id b3mr8328183wag.1171416526314; Tue, 13 Feb 2007 17:28:46 -0800 (PST) Original-Received: by 10.114.234.16 with HTTP; Tue, 13 Feb 2007 17:28:46 -0800 (PST) In-Reply-To: <45D2630F.70105@ig.com.br> Content-Disposition: inline X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) 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:66357 Archived-At: On 2/14/07, Vinicius Jose Latorre wrote: > Type > M-: (format "%03.3f" 1.2) RET > ==> "1.200" > > Shouldn't it be "001.200"? >>From format's docstring: The basic structure of a %-sequence is % character where flags is [- #0]+, width is [0-9]+, and precision is .[0-9]+ You're saying "flag = 0, width = 3, precision = 3". That overflows the width = 3. Try (format "%07.3f" 1.2) => "001.200" Juanma