WordPress.org

Make WordPress Core

Ticket #12915: 12915.patch

File 12915.patch, 511 bytes (added by solarissmoke, 3 years ago)

Round output of max upload file size to 2 decimal places

  • wp-admin/includes/template.php

     
    804804        $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); 
    805805        $log = log( $bytes, 1024 ); 
    806806        $power = (int) $log; 
    807         $size = pow(1024, $log - $power); 
    808         return $size . $units[$power]; 
     807        $size = pow( 1024, $log - $power ); 
     808        return round( $size, 2 ) . $units[$power]; 
    809809} 
    810810 
    811811/**