Format a number as currency! I can't find any help on this simple problem.
bignose+hates-spam at benfinney.id.au
Wed Oct 11 05:46:17 CEST 2006
Richard Kessler <richard.kessler at matteicos.com> writes:
> I am relatively new to Python. Love it, but I find things that I
> can do easily in .NET and cannot find a way to do in Python. I need
> to format a number as currency, for example 12343.56 to $12,343.56.
> In C# all I need to do is decimal x = 12343.56 then
Rather than implement a custom format, Python provides the 'locale'
module to handle locale-specific things like digit-grouping.
\ "About four years ago, I was -- no, it was yesterday." -- |
`\ Steven Wright |
More information about the Python-list