#14240: filesizeformat should localize number ---------------------------------------------------+------------------------ Reporter: David Danier <david.dan...@team23.de> | Owner: nobody Status: new | Milestone: Component: Uncategorized | Version: 1.2 Keywords: | Stage: Unreviewed Has_patch: 0 | ---------------------------------------------------+------------------------ Currently filesizeformat always displays file size in english number formating. But as we now have formats.number_format() I think this should be used. Possible example:
{{{ In [1]: from django.template.defaultfilters import filesizeformat In [2]: filesizeformat(100) Out[2]: u'100 bytes' In [3]: filesizeformat(1000) Out[3]: u'1000 bytes' In [4]: filesizeformat(2000) Out[4]: u'1.9 KB' In [5]: filesizeformat(15000) Out[5]: u'14.6 KB' In [6]: from django.utils import translation In [7]: translation.activate('de') In [8]: filesizeformat(15000) Out[8]: u'14,6 KB' In [9]: filesizeformat(1500000) Out[9]: u'1,4 MB' In [10]: filesizeformat(1500000000) Out[10]: u'1,3 GB' In [11]: filesizeformat(1500000000000) Out[11]: u'1,3 TB' }}} Patch follows. -- Ticket URL: <http://code.djangoproject.com/ticket/14240> Django <http://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-upda...@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.