I am using Smarty and one of my section shows file names, including dates, file size, last access etc...
I want to display the size of the file in K if less then 1024, in Mb if less than 1048576 etc...
The data (file info) comes from the database (name, file size, date etc...)
ex:
File Mime Size Date
Filename1.jpg mime/jpg 14.1Kb 2011/12/12
Is there any modifier in Smarty that do this?
Thanks
create a file in the plugin directory called:
modifier.filesize.php
then add this code:
then you can use:
{$filename.size|filesize}
assuming the size you are giving is originally in bytes,
try this: