#31487: Add support for precision argument to Round
-------------------------------------+-------------------------------------
Reporter: Baptiste Mispelon | Owner: Hasan
| Ramezani
Type: New feature | Status: assigned
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Baptiste Mispelon):
Replying to [comment:3 felixxm]:
> Please take into account that it was
[https://github.com/django/django/pull/9622#issuecomment-401628781
discussed] in the original [https://github.com/django/django/pull/9622
PR], and we decided to leave `Round()` without a precision because it can
be unstable around `0.5`.
What does "unstable around 0.5" mean? I assume it has something to do with
what Python call rounding modes [1] but if that's the case I don't
understand why that wouldn't also apply to rounding to integers.
The comment you link doesn't have a lot of information and itself links to
another comment about Spatialite which doesn't really clarify much.
Navigating the discussion on the PR is a bit hard but searching for the
word "round" in the commit history of the PR I found
https://github.com/django/django/pull/9622/commits/5acc1162a716c4ff6fcb0bca32840e11d6585c7e.
The warning added in that commit seems like it was not integrated into the
final commit (I searched Django's history with `git log -S "equally close"
-- docs/` to try and find it) but I can't find a comment explaining the
decision to remove it.
[1] https://docs.python.org/3/library/decimal.html#rounding-modes
--
Ticket URL: <https://code.djangoproject.com/ticket/31487#comment:4>
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/067.04501dc94b095200b4e25e028f6bc097%40djangoproject.com.