Edit on GitHub
Jump to docs navigation

Twig Components / Methods / format_bytes

format_bytes(precision = 2) is a Twig filter to show the size of a file in an user-friendly way. The filter renders the file size in it's respected: 'B', 'KB', 'MB', 'GB', 'TB'.

Installation:

https://packagist.org/packages/pnz/twig-extension-number

Source: Twig



Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.