#36030: Expressions that divide an integer field by a constant decimal.Decimal
returns no inconsistent decimal places on PostgreSQL
-------------------------------------+-------------------------------------
     Reporter:  Bartłomiej Nowak     |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  5.1
  (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
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

 * stage:  Unreviewed => Accepted
 * summary:
     Rendering decimal to SQL is incoherent and leads to bugs. It relays on
     str formating not type.
     =>
     Expressions that divide an integer field by a constant decimal.Decimal
     returns no inconsistent decimal places on PostgreSQL

Comment:

 I was able to replicate. Note that when using `Decimal("3.0")` it returns
 `Decimal("0.66666666666666666666")`
 Same thing on SQLite, I consistently get `Decimal("0")`
 I'm not sure what this _should_ do but I agree this is confusing and
 requires more investigation

 Thank you for the ticket
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36030#comment:6>
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 visit 
https://groups.google.com/d/msgid/django-updates/01070193e4f1fc29-5b6b5508-fa96-4b85-8cba-2f4ad37fd720-000000%40eu-central-1.amazonses.com.

Reply via email to