#16881: db.backends.util.format_number fails with valid inputs
-----------------------------------------+-------------------------------
               Reporter:  anonymous      |          Owner:  nobody
                   Type:  Uncategorized  |         Status:  closed
              Milestone:                 |      Component:  Uncategorized
                Version:  1.3            |       Severity:  Normal
             Resolution:  invalid        |       Keywords:
           Triage Stage:  Unreviewed     |      Has patch:  0
    Needs documentation:  0              |    Needs tests:  0
Patch needs improvement:  0              |  Easy pickings:  1
                  UI/UX:  0              |
-----------------------------------------+-------------------------------
Changes (by aaugustin):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 In fact, Django interprets `max_digits` as the total number of digits —
 before and after the decimal point.

 See https://docs.djangoproject.com/en/dev/ref/models/fields/#decimalfield

 So your example should be written like this:

 {{{
 format_number(Decimal('914123.22'), 8, 2)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16881#comment:2>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to