printing float as formatted dollars

Tim nospam-trice at comcast-nospam.net
Wed May 5 00:18:33 EDT 2004


"Peter Hansen" <peter at engcorp.com> wrote in message
news:lsmdnXfkzI1VwwjdRVn-vw at powergate.ca...
> 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

Peter,
Thanks for the referral to the recent post.  I'm only a few months into
Python and, to be perfectly honest, I've been shying away from the chapters
in my books regarding the re module.  This was helpful.

Thanks,
Tim





More information about the Python-list mailing list