Module Description
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 }}

 



Project Usage
1068
Creation Date
Changed Date
Security Covered
Covered By Security Advisory
Version Available
Production
Module Summary
This module solves the issue of displaying file sizes in a user-friendly format in Twig templates.
Data Name
format_bytes

OPENAI CHATBOT

OPENAI CHATBOT

14:37:11
Generic Chatbot
Hi, I'm a Drupal module expert powered by OpenAI, answering your questions about the Drupal module ecosystem. How can I be helpful today? Please note that we will log your question.