In order to format numbers with thousands separator and custom number
of decimals, I created the following function and included it in my
"db.py" model so it could be accessed through the entire application.
def number_format(num, places=0):
return locale.format("%.*f", (places, num), True)
I
Possibly the python version in your production server.
str.format() is available since python 2.6.
--
Vinicius Assef.
On Mon, Nov 7, 2011 at 7:41 PM, Franklin Freitas
wrote:
> In order to format numbers with thousands separator and custom number
> of decimals, I created the following function
2 matches
Mail list logo