#32955: widthratio does not round properly
-------------------------------------------+------------------------
Reporter: alfonsrv | Owner: nobody
Type: Uncategorized | Status: new
Component: Template system | Version: 3.1
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-------------------------------------------+------------------------
The documentation states, quote
175/200 = .875; .875 * 100 = 87.5 which is rounded up to 88
Using the example provided in the official documentation produces 88px.
However when dividing 5/2, it results in 2 instead of what I would expect
to be 3.
{{{
{% widthratio 5 2 1 as width %}
The width is: {{ width }} {# results in 2 instead of 3 #}
}}}
https://docs.djangoproject.com/en/3.0/ref/templates/builtins/#:~:text=87.5%20which%20is%20rounded%20up%20to%2088
--
Ticket URL: <https://code.djangoproject.com/ticket/32955>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.c260ce7eb7030e13d6366ff3a6254628%40djangoproject.com.