Formatting question : printing numbers with thousands separators ?

Fred Pacquier fredp at mygale.org.nospam
Fri Aug 31 10:48:13 EDT 2001


Joonas Paalasmaa <joonas at olen.to> said :

>> how do I print 246814345 as 246,814,345 (or 246 814 345) ?
> 
> If that number has fixed number of characters you can use slicing
> 
Unfortunately the numbers are file sizes so no such luck :)
Emile's tip works nicely though.
fp
-- 
YAFAP : http://www.multimania.com/fredp/



More information about the Python-list mailing list