#31841: DecimalField doesnt't respect max_digits when converting
-------------------------------------+-------------------------------------
Reporter: Thiago Bellini | Owner: nobody
Ribeiro |
Type: Bug | Status: closed
Component: Database layer | Version: 3.0
(models, ORM) |
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by felixxm):
* resolution: wontfix => duplicate
Comment:
We could use `quantize()` that accepts `context`, e.g.
{{{
v = self.context.create_decimal_from_float(value)
quantize_value = decimal.Decimal(1).scaleb(-self.decimal_places)
return v.quantize(quantize_value, context=self.context)
}}}
but first we need to support a custom context (#26459), because the
default behavior may not be appropriate for all users. I would treat this
as a part of #26459.
--
Ticket URL: <https://code.djangoproject.com/ticket/31841#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/068.4f25dcf61c45bd5549c3090344a5f171%40djangoproject.com.