On Fri, 2009-03-20 at 07:29 -0700, ihome wrote: > Hi, > > I have to load lots of float numbers into my html pages in list or > list of list format. Even though django template allows me to use a > filter to control the precision of float numbers it is still a pain. > So are the use of "%.2f" each to dump the float numbers. > > Does anyone know whether django template supports a global setting to > render all float numbers in a specified precision. Does python have > such a global setting?
The answer to both question is "no". Python (and Django, following Python's lead) favours explicit over implicit. This is a perfect case for a custom template filter. They're easy to write and fully supported, intentionally, so that particular operations that are common in your particular situation can be made easier to read in a template. Regards, Malcolm --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---