10000 Merge branch '6.3' into 6.4 · symfony/symfony-docs@47fdf40 · GitHub
[go: up one dir, main page]

Skip to content

Commit 47fdf40

Browse files
committed
Merge branch '6.3' into 6.4
* 6.3: Update formatterhelper.rst
2 parents 28e3062 + 5819a4a commit 47fdf40

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

components/console/helpers/formatterhelper.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,15 @@ precision (default ``1``) of the result::
136136
.. versionadded:: 6.4
137137

138138
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

Comments
 (0)
0