diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-07-06 20:19:44 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-07-06 20:19:44 -0400 |
commit | 5e560e9bd94949923e112603cac6148ca9db325d (patch) | |
tree | b1b3df66e80ab5d8c894502200c0ae2bb047dbf5 /lib | |
parent | 2212b5b5d74012ca3b6b1d1eefba2a00c2ec9218 (diff) | |
parent | 45bda0997f4cd591c4dab83a5a9bd73de2e98c3e (diff) | |
download | nextcloud-server-5e560e9bd94949923e112603cac6148ca9db325d.tar.gz nextcloud-server-5e560e9bd94949923e112603cac6148ca9db325d.zip |
Merge branch 'master' into sharing
Diffstat (limited to 'lib')
-rw-r--r-- | lib/template.php | 8 |
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. */ |