From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 59E04BC0B for ; Sun, 4 Feb 2007 11:41:53 +0100 (CET) Received: from outmx018.isp.belgacom.be (outmx018.isp.belgacom.be [195.238.4.117]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l14Afqe5006247 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 4 Feb 2007 11:41:53 +0100 Received: from outmx018.isp.belgacom.be (localhost [127.0.0.1]) by outmx018.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id l14AflYW001393 for ; Sun, 4 Feb 2007 11:41:47 +0100 (envelope-from ) Received: from poincare.swapping.umh.ac.be (143.119-201-80.adsl-dyn.isp.belgacom.be [80.201.119.143]) by outmx018.isp.belgacom.be (8.12.11.20060308/8.12.11/Skynet-OUT-2.22) with ESMTP id l14Afknt001385; Sun, 4 Feb 2007 11:41:46 +0100 (envelope-from ) Received: from localhost ([127.0.0.1]) by poincare.swapping.umh.ac.be with esmtp (Exim 4.63) (envelope-from ) id 1HDeoc-0001dV-0v; Sun, 04 Feb 2007 11:41:46 +0100 Date: Sun, 04 Feb 2007 11:41:45 +0100 (CET) Message-Id: <20070204.114145.182918936.Christophe.Troestler+ocaml@umh.ac.be> To: caml-list@inria.fr Subject: Re: [Caml-list] sprintf-Bug? From: Christophe TROESTLER In-Reply-To: <20070204015122.GA3882@first.in-berlin.de> References: <20070204010040.GC3829@first.in-berlin.de> <20070204015122.GA3882@first.in-berlin.de> X-Face: #2fb%mPx>rRL@4ff~TVgZ"<[:,oL"`TUEGK/[8/qb58~C>jR(x4A+v/n)7BgpEtIph_neoLKJBq0JBY9:}8v|j Organization: University of Mons-Hainaut X-Mailer: Mew version 5.1.52 on Emacs 22.0.93 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45C5B870.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 troestler:01 christophe:01 troestler:01 ocaml:01 umh:01 bandel:01 in-berlin:01 printf:01 sprintf:01 2007,:98 wrote:01 oliver:01 oliver:01 caml-list:01 On Sun, 4 Feb 2007, Oliver Bandel wrote: > > And "%0s" should make it with a filling-char '0' > instead of filling-chars ' '. No, reread the documentation: - [0]: for numerical conversions, pad with zeroes instead of spaces. ^^^^^^^^^^^^^^^^^^^^^^^^^ %s is not a numerical conversion > Or how to make hex-output with filling '0' instead > of ' ' for two-char length strings? Printf.sprintf "%02X" 12 You have to tell the length here otherwise no filling is necessary. ChriS