[plug] [OT] Adding leading zeros in python

rpowersau at gmail.com rpowersau at gmail.com
Tue Dec 21 19:32:11 WST 2004


On Tue, 21 Dec 2004 18:10:46 +0800, James Devenish
<devenish at guild.uwa.edu.au> wrote:
> In message <20041221085535.GD25656 at patrick.wattle.id.au>
> on Tue, Dec 21, 2004 at 04:55:35PM +0800, Cameron Patrick wrote:
> > Try 'file%.2d' (note the decimal point).
> 
> Hmmm, I think 'file%02d' would be better practice to teach. And it
> can be combined with floating-point precision if you want it (e.g.
> 'file%05.2f').

Yup, that worked.  :)

How do they differ? What's the advantage of one over the other? Is one
obsoleted?

Thanks.

> 
> 
> _______________________________________________
> PLUG discussion list: plug at plug.linux.org.au
> http://spark.plug.linux.org.au/cgi-bin/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au
> 


-- 
Regards,
Russ



More information about the plug mailing list