printing float as formatted dollars

Peter Hansen peter at engcorp.com
Sun May 2 16:51:14 EDT 2004


Tim wrote:

> Is there a simple way to output float values as formatted dollar amounts?
> i.e. 127379.42  as  $127,379.42

The following recent thread would probably give you several ways that
fit the "simple" requirement, provided you are really interested in
writing something that has no internationalization support and ignores
the local conventions.  (If you want i18n, use the locale module.)

http://groups.google.ca/groups?&threadm=e567c03a.0404280035.79d0d973%40posting.google.com

-Peter



More information about the Python-list mailing list