[wp-trac] [WordPress Trac] #12915: When uploading a file, remaining disk space has too many digits.

WordPress Trac wp-trac at lists.automattic.com
Thu Apr 8 09:19:18 UTC 2010


#12915: When uploading a file, remaining disk space has too many digits.
-------------------------+--------------------------------------------------
 Reporter:  giovans      |       Owner:            
     Type:  enhancement  |      Status:  new       
 Priority:  normal       |   Milestone:  Unassigned
Component:  Template     |     Version:            
 Severity:  normal       |    Keywords:            
-------------------------+--------------------------------------------------
 When I'm importing a blog the upload form shows to me a message telling
 the maximum size allowed for the file.

 If my remaining size is less than the max_upload_file_size, the former is
 showed. Tipically this number is not a perfect power of two.
 So the message says: (Maximum size: 4.5334252MB).

 I think this information is slightly too detailed.

 This can be changed in the following way:

 In the file /wp-admin/includes/template.php ,
 in the function wp_convert_bytes_to_hr

 Change:
 {{{
 $size = pow(1024, $log - $power);
 }}}

 To:
 {{{
 $size = sprintf("%.2f",pow(1024, $log - $power))
 }}}
 ;

 Or something like that.

 Thanks for your attention and amazing work.

 Giovans

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12915>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list