[Tutor] string formatting currency

Paul D. Kraus paul.kraus at gmail.com
Tue Jun 20 19:49:20 CEST 2006


How can i print a float as a currency with commas.

1222333.4 -> 1,222,333.40

if i '%0.2f'%number

i get
1222333.40

Thanks,
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060620/be1099fa/attachment.htm 


More information about the Tutor mailing list