0

Is there an easy way to change the File Module's {file_size} variable from its default output of bytes, into megabytes?

Seems just slack not to provide a better user friendly output that what's on offer out of the box.

1

It would be better to use any mathematics plugin which to calculate megabytes from bytes. You can use Simple Math plugin and use tag like

{exp:simple_math calculate="{file_size} / 1024"}
| improve this answer | |
  • Thanks, that's a start. Shame there's no built in 'friendly' flag that outputs KB size up to 1MB, then MB up to 1GB etc. – Brendan Underwood Sep 2 '13 at 1:24
  • Thanks! I am also very surprised we need a plugin to do this. – jthomas Mar 3 '14 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.