>>> import locale >>> locale.setlocale(locale.LC_ALL, '') 'en_US.UTF-8' >>> locale.format('%.2f', 1021212.12, True) '1,021,212.12' >>>
On Wed, Apr 9, 2008 at 1:04 PM, Kelie <[EMAIL PROTECTED]> wrote: > Hello, > > Is there something in Python built-in function or library that will > convert a number 1205466.654 to $1,205,466.65? To add the "$" sign and set > the decimal place is not a problem, but I don't know how to add the > thousands delimiter. > > Thanks, > > -- > Kelie > UliPad <http://code.google.com/p/ulipad/> is my Python editor. > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list