summaryrefslogtreecommitdiffstats
path: root/lib/template.php
diff options
context:
space:
mode:
authorJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-07-07 01:27:16 +0200
committerJan-Christoph Borchardt <JanCBorchardt@fsfe.org>2011-07-07 01:27:16 +0200
commite3fd72dc1627ef1cbfd4c525ea5428e68942e80a (patch)
treece21e8d9a788bbb6710956709018067ff31ab391 /lib/template.php
parentaa3b76e3fb8e46182ca892d0e8bf468a8cf0c3a0 (diff)
downloadnextcloud-server-e3fd72dc1627ef1cbfd4c525ea5428e68942e80a.tar.gz
nextcloud-server-e3fd72dc1627ef1cbfd4c525ea5428e68942e80a.zip
introducing simple file size, only MB as unit, details on hover
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.
*/