Formatting question : printing numbers with thousands separators ?

Fred Pacquier fredp at mygale.org.nospam
Fri Aug 31 11:05:07 EDT 2001


"John W. Baxter" <jwbaxter at spamcop.com> said :

>> how do I print 246814345 as 246,814,345 (or 246 814 345) ?
> 
> Or 246.814.345  ;-).  Any others?
> I think there is room for a module which "does what Microsoft Excel
> does" based on format strings, if not a bit more.
> Is there such a module?

Turns out there is -- "locale", strangely enough :)

Will need to test how portable it is, but works fine on Windows right now.

-- 
YAFAP : http://www.multimania.com/fredp/



More information about the Python-list mailing list