WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 8 years ago

#12915 closed enhancement (duplicate)

When uploading a file, remaining disk space has too many digits.

Reported by: giovans Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Import Keywords: has-patch
Focuses: Cc:

Description

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

Attachments (1)

12915.patch (511 bytes) - added by solarissmoke 11 years ago.
Round output of max upload file size to 2 decimal places

Download all attachments as: .zip

Change History (5)

#1 @nacin
11 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.1

#2 @solarissmoke
11 years ago

  • Keywords has-patch added; needs-patch removed

@solarissmoke
11 years ago

Round output of max upload file size to 2 decimal places

#3 @jane
10 years ago

  • Milestone changed from 3.1 to Future Release

Too late, going beta. Can get this in 3.2.

#4 @SergeyBiryukov
8 years ago

  • Component changed from Template to Import
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #19067.

Note: See TracTickets for help on using tickets.