Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'completeness': 0.05; 'python': 0.08; 'integers': 0.09; 'padding': 0.09; 'skip:{ 20': 0.09; 'to:name:python-list@python.org': 0.09; '>>>': 0.12; 'message-----': 0.12; "'test": 0.16; '712': 0.16; 'affiliates,': 0.16; 'currencies': 0.16; 'eg.': 0.16; 'opened,': 0.16; 'pad': 0.16; 'padded': 0.16; 'padding.': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:169.70': 0.16; 'received:169.70.184': 0.16; 'received:172.18.0': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'solicitation': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'cheers,': 0.19; 'thanks,': 0.19; 'insert': 0.19; 'to:2**1': 0.20; 'header:In- Reply-To:1': 0.21; 'variable': 0.21; 'applicable,': 0.23; 'herein': 0.23; 'received:169': 0.25; 'received:169.254': 0.25; 'url:mailman': 0.26; 'testing': 0.27; 'reflect': 0.28; 'all,': 0.30; 'subject:': 0.30; 'url:listinfo': 0.30; 'chase': 0.30; 'received:155': 0.30; 'received:159': 0.30; 'received:169.254.1': 0.30; 'print': 0.31; 'header:Received:8': 0.32; "can't": 0.32; '(including': 0.32; 'someone': 0.33; 'to:addr:python-list': 0.33; 'sent:': 0.34; 'thank': 0.35; 'received:172.18': 0.35; 'skip:{ 10': 0.35; 'phone:': 0.36; 'format.': 0.36; 'from:': 0.36; 'accepted': 0.36; 'charset:us-ascii': 0.36; 'change': 0.37; 'accuracy': 0.37; 'arising': 0.37; 'desirable': 0.37; 'tips': 0.37; 'skip:- 10': 0.37; 'url:python': 0.38; 'url:org': 0.38; 'but': 0.38; 'data': 0.38; 'purposes': 0.38; 'subject:: ': 0.38; 'some': 0.38; 'comments': 0.39; 'sometimes': 0.39; 'legally': 0.39; 'to:addr:python.org': 0.39; 'under': 0.40; 'format': 0.40; 'you.': 0.62; 'subject': 0.62; 'market': 0.63; 'virus': 0.63; 'free': 0.63; 'applicable': 0.65; 'co.,': 0.65; 'contact': 0.66; 'relating': 0.67; 'legal': 0.70; 'offer': 0.71; 'sale': 0.76; 'bank': 0.76; 'june': 0.77; 'investment': 0.78; 'purchase': 0.83; 'affiliates.': 0.84; 'amount.': 0.84; 'fashion,': 0.84; 'prices,': 0.84; 'defect': 0.91; 'instrument': 0.95; 'notice.': 0.96 X-DKIM: Sendmail DKIM Filter v2.8.4 sz4.jpmchase.com p57Lson3005007 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=jpmchase.com; s=smtpout; t=1307483690; bh=buhOkQjre0ooLGbhyKcvukHS0zz4eNh6qUTMtN3dk3o=; h=From:To:Date:Subject:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=MPmO7ahLWJqVj336BZVM00WopbnBV60UHGHigj7grreGrBZzf7tzrt2VjqWAR7a5H 8wcujfyK4PajT1MdAhTT6ZVbGB8gFa4WmaKFata1hMim1Z0HHZnVAa12KBjz2VveuI JqyoCwFqCxGSiwwUgf2O+sXDp6YQd3pMng7t2Q7I= From: "Prasad, Ramit" To: Friedrich Clausen , "python-list@python.org" Date: Tue, 7 Jun 2011 17:54:41 -0400 Subject: RE: Dynamic Zero Padding. Thread-Topic: Dynamic Zero Padding. Thread-Index: AcwlW6MzVM5YxL4LRvOcGZPjhPr1kgAAapfQ References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 42 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307483788 news.xs4all.nl 49175 [::ffff:82.94.164.166]:59090 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7196 Python 2=2E6=2Ex=0D=0A>>> 'test {0:=2E2f}'=2Eformat(1)=0D=0A'test 1=2E00'= =0D=0A>>> 'test {0:{1}f}'=2Eformat(1,2)=0D=0A'test 1=2E000000'=0D=0A>>> 'te= st {0:{1}f}'=2Eformat(1,=2E2)=0D=0A'test 1=2E00'=0D=0A>>> 'test {0:=2E{1}f}= '=2Eformat(1,2)=0D=0A'test 1=2E00'=0D=0A=0D=0A=0D=0ARamit=0D=0A=0D=0A=0D=0A= Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology=0D=0A= 712 Main Street | Houston, TX 77002=0D=0Awork phone: 713 - 216 - 5423=0D=0A= =0D=0A=0D=0A-----Original Message-----=0D=0AFrom: python-list-bounces+ramit= =2Eprasad=3Djpmchase=2Ecom@python=2Eorg [mailto:python-list-bounces+ramit= =2Eprasad=3Djpmchase=2Ecom@python=2Eorg] On Behalf Of Friedrich Clausen=0D= =0ASent: Tuesday, June 07, 2011 4:37 PM=0D=0ATo: python-list@python=2Eorg= =0D=0ASubject: Dynamic Zero Padding=2E=0D=0A=0D=0AHello All,=0D=0A=0D=0AI w= ant to print some integers in a zero padded fashion, eg=2E :=0D=0A=0D=0A>>>= print("Testing %04i" % 1)=0D=0ATesting 0001=0D=0A=0D=0Abut the padding nee= ds to be dynamic eg=2E sometimes %05i, %02i or some=0D=0Aother padding amou= nt=2E But I can't insert a variable into the format=0D=0Aspecification to a= chieve the desirable padding=2E=0D=0A=0D=0AI would be much obliged if someo= ne can give me some tips on how to=0D=0Aachieve a variably pad a number=2E= =0D=0A=0D=0ACheers,=0D=0A=0D=0AFred=2E=0D=0A=0D=0AThanks,=0D=0A=0D=0AFred= =2E=0D=0A-- =0D=0Ahttp://mail=2Epython=2Eorg/mailman/listinfo/python-list= =0D=0AThis communication is for informational purposes only=2E It is not=0D= =0Aintended as an offer or solicitation for the purchase or sale of=0D=0Aan= y financial instrument or as an official confirmation of any=0D=0Atransacti= on=2E All market prices, data and other information are not=0D=0Awarranted = as to completeness or accuracy and are subject to change=0D=0Awithout notic= e=2E Any comments or statements made herein do not=0D=0Anecessarily reflect= those of JPMorgan Chase & Co=2E, its subsidiaries=0D=0Aand affiliates=2E= =0D=0A=0D=0AThis transmission may contain information that is privileged,= =0D=0Aconfidential, legally privileged, and/or exempt from disclosure=0D=0A= under applicable law=2E If you are not the intended recipient, you=0D=0Aare= hereby notified that any disclosure, copying, distribution, or=0D=0Ause of= the information contained herein (including any reliance=0D=0Athereon) is = STRICTLY PROHIBITED=2E Although this transmission and any=0D=0Aattachments = are believed to be free of any virus or other defect=0D=0Athat might affect= any computer system into which it is received and=0D=0Aopened, it is the r= esponsibility of the recipient to ensure that it=0D=0Ais virus free and no = responsibility is accepted by JPMorgan Chase &=0D=0ACo=2E, its subsidiaries= and affiliates, as applicable, for any loss=0D=0Aor damage arising in any = way from its use=2E If you received this=0D=0Atransmission in error, please= immediately contact the sender and=0D=0Adestroy the material in its entire= ty, whether in electronic or hard=0D=0Acopy format=2E Thank you=2E=0D=0A=0D= =0APlease refer to http://www=2Ejpmorgan=2Ecom/pages/disclosures for=0D=0Ad= isclosures relating to European legal entities=2E