#37037 closed defect (bug) (fixed)
size_format() incorrectly displays `kB` with small `k`
Reported by: | dashaluna | Owned by: | Presskopp |
---|---|---|---|
Milestone: | 4.6 | Priority: | normal |
Severity: | normal | Version: | 2.3 |
Component: | General | Keywords: | good-first-bug has-patch |
Focuses: | Cc: |
Description
The size_format()
incorrectly displays kB
unit. It should be KB
.
Attachments (4)
Change History (17)
#2
@
4 years ago
Related: #31350.
I don't mind this change - traditionally, kB
has been the most common usage, but it seems to have changed to KB
over the years, shifting from the SI standard, where kB
= 1000 bytes, to the JEDEC standard, where KB
= 1024 bytes.
Switching to the IEC standard (KiB
, etc) is a much bigger discussion, particularly because those units have never really seen significant uptake. (Because they look weird, and all of the units are really awkward to say.)
#3
@
4 years ago
I feel that whatever the decision will be, it should be consistent. As we're displaying file sizes in a table with all measurements being in capitals and kB
looks like an oversight.
You get something looking:
GB
MB
kB
B
Sorry for being pedantic :)
#4
@
4 years ago
IMHO we could just keep kB, even it maybe painful for your eyes, @dashaluna :)
See Table here: https://en.wikipedia.org/wiki/Kilobyte
Just for the record, we see it used here:
\wp-includes\ID3\module.audio.mp3.php, L.1375
round($sync_seek_buffer_size / 1024).'kB';
and as a comment here:
\wp-includes\ID3\module.audio-video.riff.php, L.1695
} elseif ($chunksize < 2048) { // only read data in if smaller than 2kB
#6
follow-up:
↓ 7
@
4 years ago
@DrewAPicture Why not, so you say it should be patched to KB?
If so, we also have it in
wp-includes/deprecated.php, L 3238
$units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );
As it's deprecated, would this also be needed to get patched?
And what if @dashaluna wants to create a patch herself?
#7
in reply to:
↑ 6
@
4 years ago
Replying to Presskopp:
@DrewAPicture Why not, so you say it should be patched to KB?
If so, we also have it in
wp-includes/deprecated.php, L 3238
$units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB', 4 => 'TB' );As it's deprecated, would this also be needed to get patched?
And what if @dashaluna wants to create a patch herself?
Yes, let's standardize on uppercase. If either you or @dashaluna would like to generate a patch, that would be fine :-)
#9
@
4 years ago
- Owner set to Presskopp
- Status changed from new to assigned
Assigning to mark the good-first-bug as "claimed".
… because 1 kB means 1000 bytes, whereas 1 KB = 1 KiB = 1024 bytes.
size_format()
assumes that 1024 bytes = 1 kB, so yeah, that sounds wrong.