[!!!][FEATURE] Support IEC/SI units in file size formatting
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Documentation / Changelog / master / Feature-22175-SupportIecSiUnitsInFileSizeFormatting.rst
1 ==============================================================
2 Feature: #22175 - Support IEC/SI units in file size formatting
3 ==============================================================
4
5 Description
6 ===========
7
8 Size formatting supports two keywords additionally to the list of labels:
9 - iec: uses the Ki, Mi, etc prefixes and binary base (power of two, 1024)
10 - si: uses the k, M, etc prefixes and decimal base (power of ten, 1000)
11
12 The default formatting is set to "iec" base size calculations on the same base as before.
13 The fractional part, when present, is changed to two numbers instead of only one.
14
15 The list of labels is still supported and defaults to using binary base. It is also
16 possible to explicitly choose between binary or decimal base when it is used.
17
18
19 Impact
20 ======
21
22 Default formatted output of file sizes changes, see example below.
23
24 TypoScript ``stdWrap`` property ``bytes`` defaults to a different label set.
25 ``bytes.labels = iec``, a specifically defined label string with pipe separated
26 label keywords is obsolete, but can still be used if required. The keyword
27 ``iec`` resolves to `` | Ki| Mi| Gi| Ti| Pi| Ei| Zi| Yi`` (binary base) and ``si`` resolves
28 to `` | k| M| G| T| P| E| Z| Y`` (based on ten).
29
30
31 Example
32 =======
33
34 .. codeblock:: php
35 echo GeneralUtility::formatSize(85123);
36 // => Before "83.1 K"
37 // => Now "83.13 Ki"