Ticket #3693: defaultfilters.diff

File defaultfilters.diff, 998 bytes (added by Simon G. <dev@…>, 18 years ago)
  • django_src/django/template/defaultfilters.py

     
    7070    With a negative numeric argument, it will display that many decimal
    7171    places -- but only if there's places to be displayed.
    7272    Examples:
    73         num1 = 34.23234
    74         num2 = 34.00000
    75         num1|floatformat results in 34.2
    76         num2|floatformat is 34
    77         num1|floatformat:3 is 34.232
    78         num2|floatformat:3 is 34.000
    79         num1|floatformat:-3 is 34.232
    80         num2|floatformat:-3 is 34
     73   
     74    * num1 = 34.23234
     75    * num2 = 34.00000
     76    * num1|floatformat results in 34.2
     77    * num2|floatformat is 34
     78    * num1|floatformat:3 is 34.232
     79    * num2|floatformat:3 is 34.000
     80    * num1|floatformat:-3 is 34.232
     81    * num2|floatformat:-3 is 34
    8182    """
    8283    try:
    8384        f = float(text)
Back to Top