#28280: numberformat.format does not handle scientific notation correctly
-----------------------------------------+------------------------
Reporter: Wil Tan | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
For floats with values larger than 1e16 or smaller than 1e-5, their string
representation uses scientific notation in Python, which causes
{{{numberformat.format}}} to return an erroneous output.
{{{
>>> format(0.0000000000000000009, '.', 2)
'9e-19.00'
>>> format(1e16, '.', 2, thousand_sep=',', grouping=3,
force_grouping=True)
'1e,+16.00'
}}}
This is similar to #23935 but that was only fixed for Decimal types.
--
Ticket URL: <https://code.djangoproject.com/ticket/28280>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/049.873ce09e00fd10eb6537fa1a0a4f1ae7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.