Project

General

Profile

Actions

Feature #22175

closed

Filelist should use IEC prefixes and appropriate units for filesize.

Added by Sigfried Arnold about 14 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2010-02-24
Due date:
% Done:

100%

Estimated time:
PHP Version:
Tags:
Complexity:
medium
Sprint Focus:

Description

The filelist shows filesizes a bit weird using an inappropriate SI prefix - it don't even uses a unit.

Examples:
124 Byte (now "124") should be "123 B"
1.428.278 Byte (now "1.4 M") should be "1.36 MiB (1.42 MB)"
1.150 Byte (now "1.1 K") should be "1.12 KiB (1.15 KB)"

http://physics.nist.gov/cuu/Units/binary.html
(issue imported from #M13645)


Files

13645.diff (2.63 KB) 13645.diff Administrator Admin, 2010-02-24 21:31
13645_v2.diff (2.63 KB) 13645_v2.diff Administrator Admin, 2010-02-24 21:42

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #69380: Set "si" as the default for cObj fileSizesRejectedStefan Froemken2015-08-28

Actions
Precedes TYPO3 Core - Task #67572: Update calls to formatSize to adjust to new unitsClosed2015-06-17

Actions
Actions #1

Updated by Sigfried Arnold about 14 years ago

I refactored the code, made it more flexible and added the corrections.

The code is fully backwards compatible but is more scaleable (till inifinity) - but i just wanted to respect the dry-principle ;)

I tested the code with TYPO3 4.2, 4.3 and 4.4 alpha - everything seems to be fine.

The essential part ist now shorter, the function itself is only a few bytes larger - excluding the comments < 100 byte.

Possibly todo (additional feature): the make the default lables and calculation base configurable via localconf.

Ready to bring it into the trunk.

Actions #2

Updated by Sigfried Arnold about 14 years ago

Well, i just figured out, i did the patch in the wrong direction - 13645_v2.diff is now correct :D

Actions #3

Updated by Alexander Opitz over 10 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)
  • TYPO3 Version set to 4.3

Hi,

as this issue is very old. Is this feature missing in newer versions of TYPO3 CMS (6.1.7)?
If yes, can you provide a newer patch against master by using Gerrit? http://wiki.typo3.org/CWT

Actions #4

Updated by Sigfried Arnold over 10 years ago

This feature is still missing - i'll make a patch against the current version if it is going to be implemented

Actions #5

Updated by Alexander Opitz over 10 years ago

  • Category set to Backend User Interface
  • Status changed from Needs Feedback to New

Ok, will help you with the review process.

Actions #6

Updated by Mathias Schreiber about 9 years ago

  • Category changed from Backend User Interface to File Abstraction Layer (FAL)
  • Target version set to 7.4 (Backend)
  • Sprint Focus set to On Location Sprint
Actions #7

Updated by Ingo Schmitt about 9 years ago

  • PHP Version deleted (4.3)
  • Complexity set to medium
Actions #8

Updated by Pierrick Caillon almost 9 years ago

  • Status changed from New to In Progress
  • Assignee set to Pierrick Caillon
Actions #9

Updated by Gerrit Code Review almost 9 years ago

  • Status changed from In Progress to Under Review

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #10

Updated by Gerrit Code Review almost 9 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #11

Updated by Gerrit Code Review almost 9 years ago

Patch set 4 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #12

Updated by Gerrit Code Review almost 9 years ago

Patch set 5 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #13

Updated by Gerrit Code Review almost 9 years ago

Patch set 6 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #14

Updated by Sigfried Arnold almost 9 years ago

Looks good - but the unit symbol is missing - this is required

the units are not k/Ki M/Mi - they are kB/KiB, MB/MiB - and note, the k for Kilo is a small k since K is reserved for Kelvin in SI: KB would be Kelvin*Byte

and thanks for your effort

Actions #15

Updated by Gerrit Code Review almost 9 years ago

Patch set 7 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #16

Updated by Gerrit Code Review almost 9 years ago

Patch set 8 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #17

Updated by Gerrit Code Review almost 9 years ago

Patch set 9 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #18

Updated by Pierrick Caillon almost 9 years ago

The formatting rules in http://physics.nist.gov/cuu/Units/checklist.html are used. Especially the number 15 applying to spacing.

Actions #19

Updated by Gerrit Code Review almost 9 years ago

Patch set 10 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #20

Updated by Gerrit Code Review almost 9 years ago

Patch set 11 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/40291

Actions #21

Updated by Pierrick Caillon almost 9 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #22

Updated by Sigfried Arnold almost 9 years ago

Pierrick Caillon wrote:

The formatting rules in http://physics.nist.gov/cuu/Units/checklist.html are used. Especially the number 15 applying to spacing.

I was not talking about the spacing or the formatting, i was talking about the missing unit symbol :) currently there is just a prefix with no unit

It should be 100 MiB or 200 kB - not just 100 Mi or 200 k - the unit symbol is mandatory, else it could be "anything" - it is pretty obvious that those are Bytes, but it does not say so.

To fix this: "B" needs to be appended to each Prefix since it cannot stand there alone.

Actions #23

Updated by Mathias Schreiber almost 9 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #24

Updated by Riccardo De Contardi over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF