Format Bytes
This module provides a Twig filter that converts raw byte values into human-readable file sizes, displaying them in units like KB, MB, or GB for better user comprehension within Drupal.
Provides a Twig Extension, that you can use in your Twig Templates. In twig when you get the value of a file, the size is in simple bytes and if you're intending to show it to your end-user, it's not user-friendly, this simple Twig filter helps with that and renders the file size in it's respected: 'B', 'KB', 'MB', 'GB', 'TB'
Example:
{{ node.field_attachment.entity.field_file.entity.filesize.value | format_bytes }}
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.