diff options
| author | Bryan Veloso <bryan@github.com> | 2012-11-04 18:19:56 -0800 |
|---|---|---|
| committer | Bryan Veloso <bryan@github.com> | 2012-11-04 18:19:56 -0800 |
| commit | 79a484fc8e2f62262e91d5073282c6f0ec497b01 (patch) | |
| tree | 76df96722d2556c85bae41a6e31eb5d2e694d40f | |
| parent | a70492e6b532905c921678f35b5c60b22387f1c6 (diff) | |
| parent | d5c3c45f2fdfee09d81ad8dc7b0db8338d6d0aae (diff) | |
Merge pull request #496 from pydanny/ticket_19241
Demonstrate how to round to integers using floatformat templatetag
| -rw-r--r-- | docs/ref/templates/builtins.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index c7fab8c53d..3220b5f611 100644 --- a/docs/ref/templates/builtins.txt +++ b/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``. |
