#14240: filesizeformat should localize number
------------------------------------------------------------+---------------
          Reporter:  David Danier <[email protected]>  |         Owner:  
anonymous
            Status:  assigned                               |     Milestone:    
       
         Component:  Template system                        |       Version:  
1.2      
        Resolution:                                         |      Keywords:    
       
             Stage:  Accepted                               |     Has_patch:  1 
       
        Needs_docs:  0                                      |   Needs_tests:  0 
       
Needs_better_patch:  0                                      |  
------------------------------------------------------------+---------------
Changes (by David Danier <[email protected]>):

  * needs_tests:  1 => 0

Comment:

 I attached an updated patch including:
  * Use of round() in filesizeformat(). This should be ok, as all numbers
 are converted to float first, so we don't need to handle
 Decimal.quantize().
  * Fix of fallback-output, which is currently not localized ("0 bytes",
 see except, 0 might be singular in some languages or something totally
 different, who knows)
  * Added tests, thanks Russel for the pointer.
  * Updated myself in AUTHORS

 About round(): I think just cutting of the last digits inside
 number_format() should be the intended behaviour. number_format() should
 not care about doing something other than just formatting the number. So
 round() must be called outside of number_format(). Perhaps Django could
 provide some generic round()-function to accomplish differences betweeen
 float and Decimal, but thats definately outside the scope of this ticket
 and number_format.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/14240#comment:7>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to