--
Ticket URL: <https://code.djangoproject.com/ticket/24916>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => wontfix
* needs_tests: => 0
* needs_docs: => 0
Comment:
The JSON standard for serializing decimal values does not provide for
localized formatting. (See JSON.org.) This is why values are not
localized. I think it would also make the date less portable across
locales.
If you need localized values, then I'd suggest to create a custom encoder
for your serializer of choice which outputs the decimals appropriately.
If you disagree and feel this is something Django should provide, please
raise the issue on the DevelopersMailingList.
--
Ticket URL: <https://code.djangoproject.com/ticket/24916#comment:1>
Comment (by vartagg):
The JSON standard for serializing decimal values does not provide for
localized formatting. (See JSON.org.) This is why values are not
localized. I think it would also make the date less portable across
locales.
By following this, support of Decimals in DjangoJSONEncoder makes sense
only for web-applications that don't use localizations.
If you need localized values, then I'd suggest to create a custom encoder
for your serializer of choice which outputs the decimals appropriately.
Ok, but DjangoJSONEncoder has only one method: "default", what making it
hard to override. How about to divide it to different methods? It would be
very helpful.
--
Ticket URL: <https://code.djangoproject.com/ticket/24916#comment:2>