We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 28e3062 + 5819a4a commit 47fdf40Copy full SHA for 47fdf40
components/console/helpers/formatterhelper.rst
@@ -136,3 +136,15 @@ precision (default ``1``) of the result::
136
.. versionadded:: 6.4
137
138
The support for exact times was introduced in Symfony 6.4.
139
+
140
+Formatting Memory
141
+-----------------
142
143
+Sometimes you want to format memory to GiB, MiB, KiB and B. This is possible with the
144
+:method:`Symfony\\Component\\Console\\Helper\\Helper::formatMemory` method.
145
+The only argument is the memory size to format::
146
147
+ Helper::formatMemory(512); // 512 B
148
+ Helper::formatMemory(1024); // 1 KiB
149
+ Helper::formatMemory(1024 * 1024); // 1.0 MiB
150
+ Helper::formatMemory(1024 * 1024 * 1024); // 1 GiB
0 commit comments