Tutorials References Exercises Videos Menu
Create Website Get Certified Upgrade

Template Filter - escapejs


Example

Display the file size in a more readable format:

<h1>{{ size|filesizeformat }}</h1>
Run Example »

Definition and Usage

The filesizeformat filter converts a large number into a more human readable format.

Examples:

 1024 is converted into 1.0 KB.

524288 is converted into 512.0 KB.


Syntax

Template filters are defined by using a pipe | character followed by the name of the filter.

{{ value|filesizeformat }}