Tutorials References Exercises Bootcamp Menu
Sign Up Create Website Get Certified Pro

Template Filter - escapejs


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.


 1024 is converted into 1.0 KB.

524288 is converted into 512.0 KB.


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

{{ value|filesizeformat }}