• Resolved carry2web

    (@carry2web)


    I added this small function to display the sizes not only in KB

    public function sizeFilter( $bytes )
    {
        $label = array( 'B', 'KB', 'MB', 'GB', 'TB', 'PB' );
        for( $i = 0; $bytes >= 1024 && $i < ( count( $label ) -1 ); $bytes /= 1024, $i++ );
                return( round( $bytes, 2 ) . " " . $label[$i] );
    }

    line 62:
    $displayoriginalspace = sizeFilter($originalspace);
    line 67:
    $displaytotalspace = sizeFilter($totalspace);

    http://wordpress.org/extend/plugins/media-file-sizes/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Display sizes not only in Kb’ is closed to new replies.