Message-ID: <2140487118.3806.1485855431446.JavaMail.confluence@ip-10-127-227-164> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3805_1646982859.1485855431446" ------=_Part_3805_1646982859.1485855431446 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html ez_file_size

ez_file_size

=20
=20
=20
=20

Description

ez_file_size() is a Twig helper (Twig filter) which is most= ly a byte calculator. It will convert a number from byte to the correct suf= fix (from B to EB). The output pattern will also vary with the current lang= uage of the site access (e.g. choosing between coma or point pattern).

It returns a string.

The byte factor is 1000 instead of 1024 to be more familiar for users.

Prototype and Arguments

 integer number_of_bytes|ez_file_= size( integer number_of_decimal )

Argument name Type Description
number_of_bytes integer The number in byte we want to convert
number_of_decimal integer
The number of decimal we want our = output to have

Usage

=20
{{ 42698273|ez_file_size( 3 ) }} //Output with french site acc=
ess : 42,698 MB

{{ 42698273|ez_file_size( 4 ) }} //Output with english site access : 42.698=
3 MB
=20
=20
=20
=20
=20

 

=20
=20
=20
------=_Part_3805_1646982859.1485855431446--