Path: csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Lawrence =?iso-8859-13?q?D=FFOliveiro?= Newsgroups: comp.lang.python Subject: Re: Formatted Integer With Specified Number Of Digits Date: Sun, 19 Oct 2025 21:39:17 -0000 (UTC) Organization: A noiseless patient Spider Lines: 17 Message-ID: <10d3lq4$2prhm$2@dont-email.me> References: <10d23rk$2bc2b$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Sun, 19 Oct 2025 21:39:17 +0000 (UTC) Injection-Info: dont-email.me; posting-host="82af3b06475bb41c8d62950873271a3d"; logging-data="2944566"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+A7/QvQjrRkaOlX05onCLJ" User-Agent: Pan/0.164 (Kupiansk) Cancel-Lock: sha1:P3bdmuiLjUMz5aE/rMM+UF1kpSM= Xref: csiph.com comp.lang.python:197570 On Sun, 19 Oct 2025 10:01:16 -0400, songbird wrote: > Lawrence D’Oliveiro wrote: >> >> Formatting an integer with 3 digits, excluding base specifier: >> >> >>> "%#0.3x" % 2 >> '0x002' >> >> No equivalent to this in any of the other ways that Python allows for >> formatting: >> >> Why not? > We already have printf-style formatting in Python, that’s what I was using above.