Skip to content

Commit 3f3f4e0

Browse files
jderusseJérémy Derussé
authored and
Jérémy Derussé
committed
Provide information about SI and Binary prefixes
1 parent deac0c3 commit 3f3f4e0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

reference/constraints/File.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,8 @@ When true, the sizes will be displayed in messages with binary suffixes (KiB, Mi
164164
When false, the sizes will be displayed with SI suffixes (kB, MB).
165165
When null, then the binaryFormat will be guessed from the suffix defined in the maxSize option.
166166

167+
For more information about the difference between binary and SI suffixes, see `Wikipedia: Binary prefix`_.
168+
167169
maxSize
168170
~~~~~~~
169171

@@ -173,19 +175,21 @@ If set, the size of the underlying file must be below this file size in order
173175
to be valid. The size of the file can be given in one of the following formats:
174176

175177
* **bytes**: To specify the ``maxSize`` in bytes, pass a value that is entirely
176-
numeric (e.g. ``4096``);
178+
numeric (e.g. ``4096``).
177179

178180
* **kilobytes**: To specify the ``maxSize`` in kilobytes, pass a number and
179-
suffix it with a "k" (e.g. ``200k``);
181+
suffix it with a "k" (e.g. ``200k``); 1k = 1 000 bytes.
180182

181183
* **megabytes**: To specify the ``maxSize`` in megabytes, pass a number and
182-
suffix it with a "M" (e.g. ``4M``).
184+
suffix it with a "M" (e.g. ``4M``); 1M = 1 000 000 bytes.
183185

184186
* **kibibytes**: To specify the ``maxSize`` in kibibytes, pass a number and
185-
suffix it with a "Ki" (e.g. ``600Ki``);
187+
suffix it with a "Ki" (e.g. ``600Ki``); 1Ki = 1 024 bytes.
186188

187189
* **mebibytes**: To specify the ``maxSize`` in mebibytes, pass a number and
188-
suffix it with a "Mi" (e.g. ``8Mi``).
190+
suffix it with a "Mi" (e.g. ``8Mi``); 1Mi = 1 048 576 bytes.
191+
192+
For more information about the difference between binary and SI suffixes, see `Wikipedia: Binary prefix`_.
189193

190194
mimeTypes
191195
~~~~~~~~~
@@ -257,3 +261,4 @@ to disk.
257261

258262

259263
.. _`IANA website`: http://www.iana.org/assignments/media-types/index.html
264+
.. _`Wikipedia: Binary prefix`: http://en.wikipedia.org/wiki/Binary_prefix

0 commit comments

Comments
 (0)