iterating in reverse

Paul Rubin phr-n2003b at NOSPAMnightsong.com
Fri Jan 17 15:01:59 EST 2003


Nick Vargish <nav at adams.patriot.net> writes:
> I just encountered a problem that required reverse iterating to solve,
> and my current solution, though it works, is not so satisfying:
> 
> def commafy(val):
>     """Return val as string with commas every thousandth place.""" ... 

If you're just looking for a practical solution, use the locale package,
which does this formatting for you.




More information about the Python-list mailing list