Re: Django and Comma-Formatting Numbers

2008-05-29 Thread James Bennett
On Thu, May 29, 2008 at 1:15 PM, David <[EMAIL PROTECTED]> wrote: > I had need of commas in floating-point numbers, and slightly modified > humanize.py with a floatcomma function: > > def floatcomma(value): >""" >Converts a float to a string containing commas every three digits. >For

Re: Django and Comma-Formatting Numbers

2008-05-29 Thread David
I had need of commas in floating-point numbers, and slightly modified humanize.py with a floatcomma function: def floatcomma(value): """ Converts a float to a string containing commas every three digits. For example, 3000.65 becomes '3,000.65' and -45000.00 becomes '-45,000.00'.

Re: Django and Comma-Formatting Numbers

2008-05-28 Thread Greg Taylor
Bingo, I could've sworn I remembered doing it somehow or another. Thanks a lot, Greg On May 28, 7:42 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Thu, May 29, 2008 at 7:26 AM, Greg Taylor <[EMAIL PROTECTED]> wrote: > > > I was wondering if there was any facility within Django that

Re: Django and Comma-Formatting Numbers

2008-05-28 Thread Russell Keith-Magee
On Thu, May 29, 2008 at 7:26 AM, Greg Taylor <[EMAIL PROTECTED]> wrote: > > I was wondering if there was any facility within Django that makes > formatting numbers with commas or periods in templates possible from > template-land. I know you can use locale.format() on the Python side, > but was

Django and Comma-Formatting Numbers

2008-05-28 Thread Greg Taylor
I was wondering if there was any facility within Django that makes formatting numbers with commas or periods in templates possible from template-land. I know you can use locale.format() on the Python side, but was hoping there was some tag/filter feature I missed that would allow me to do this