> Is there a function that will take, for example, 1234567 and return > 1,234,567? Short answer: Look into the locale module. Demo: mynum = 123456 import locale locale.setlocale(locale.LC_ALL, "") locale.format('%.0f', mynum, 3) >>> '123,456' // m -