On Sat, Mar 14, 2009 at 11:02 AM, ihome <ihomest...@gmail.com> wrote:
> > is there an easy way to control the precision for float values? for > example, i have this in my template: > > <input type=text value="{{ p }}" /> > > where float p = 0.1234123413 but i only want to show p with 3 digits > after dot like 0.123. is there a predefined way to control the > precision in the rendering of template instead of having to re-format > the output of the float in my code. > > thanks. > > > Take a look at the floatformat filter: http://docs.djangoproject.com/en/dev/ref/templates/builtins/?from=olddocs#floatformat Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." --Voltaire "The people's good is the highest law."--Cicero --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---