summaryrefslogtreecommitdiffstats
path: root/system/application/helpers/filebin_helper.php
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-07-11 20:54:26 +0200
committerFlorian Pritz <bluewind@xssn.at>2010-07-11 20:55:54 +0200
commiteb98a1b4b2ccebd75924cd56cb286573186cc283 (patch)
tree2fc216d31678ab1fbafe514ab5f15df4be233098 /system/application/helpers/filebin_helper.php
parent00596f828d9e964ed008020ea104e96e77824578 (diff)
display minimum deletion size on upload_form
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'system/application/helpers/filebin_helper.php')
-rw-r--r--system/application/helpers/filebin_helper.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/system/application/helpers/filebin_helper.php b/system/application/helpers/filebin_helper.php
new file mode 100644
index 000000000..34b231023
--- /dev/null
+++ b/system/application/helpers/filebin_helper.php
@@ -0,0 +1,9 @@
+<?php
+
+// Source: http://ibnuyahya.com/format-bytes-to-kb-mb-gb/
+function format_bytes($size, $precision = 2){
+ $base = log($size) / log(1024);
+ $suffixes = array('B', 'kB', 'MB', 'GB', 'TB' , 'PB' , 'EB');
+ return round(pow(1024, $base - floor($base)), $precision) . $suffixes[floor($base)];
+}
+