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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy