summaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/template.php')
-rw-r--r--lib/template.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/template.php b/lib/template.php
index 9393fe6908e..3c0cdf7e161 100644
--- a/lib/template.php
+++ b/lib/template.php
@@ -67,6 +67,14 @@ function human_file_size( $bytes ){
return OC_HELPER::humanFileSize( $bytes );
}
+function simple_file_size($bytes) {
+ $mbytes = round($bytes/(1024*1024),1);
+ if($bytes == 0) { return '0'; }
+ else if($mbytes < 0.1) { return '< 0.1'; }
+ else if($mbytes > 1000) { return '> 1000'; }
+ else { return number_format($mbytes, 1); }
+}
+
/**
* This class provides the templates for owncloud.
*/