Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #496 from pydanny/ticket_19241

Demonstrate how to round to integers using floatformat templatetag
  • Loading branch information...
commit 79a484fc8e2f62262e91d5073282c6f0ec497b01 2 parents a70492e + d5c3c45
Bryan Veloso authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 docs/ref/templates/builtins.txt
View
11 docs/ref/templates/builtins.txt
@@ -1528,6 +1528,17 @@ displayed. For example:
``34.26000`` ``{{ value|floatformat:"-3" }}`` ``34.260``
============ ================================ ==========
+If the argument passed to ``floatformat`` is 0 (zero), it will round the number
+to the nearest integer.
+
+============ ================================ ==========
+``value`` Template Output
+============ ================================ ==========
+``34.23234`` ``{{ value|floatformat:"0" }}`` ``34``
+``34.00000`` ``{{ value|floatformat:"0" }}`` ``34``
+``39.56000`` ``{{ value|floatformat:"0" }}`` ``40``
+============ ================================ ==========
+
Using ``floatformat`` with no argument is equivalent to using ``floatformat``
with an argument of ``-1``.
Please sign in to comment.
Something went wrong with that request. Please try again.