Peter Hansen wrote: >> The target of the problems (my daughter) would prefer that the thousands >> be delimited. Is there a string function that does this? > > You refer to something like putting a comma between groups of three > digits, as in 1,000? This is locale-specific, and there's a "locale" > module that should have what you need.
>>> import locale >>> locale.setlocale(locale.LC_ALL, '') 'English_United Kingdom.1252' >>> print locale.format("%d", 1000000, True) 1,000,000 >>> print locale.format("%.2f", 1000000, True) 1,000,000.00 >>> locale.setlocale(locale.LC_ALL, 'fr') 'French_France.1252' >>> print locale.format("%d", 1000000, True) 1 000 000 >>> print locale.format("%.2f", 1000000, True) 1 000 000,00 -- http://mail.python.org/mailman/listinfo/python-list