summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-17 12:15:12 +0100
committerVincent Petry <pvince81@owncloud.com>2014-03-17 12:15:12 +0100
commit145db370d1e83978d0e575a60d7d61fbe1039cc4 (patch)
tree4322274789cb86cc05c7ca9ca87a45b8ffd58a0d /lib
parent518903c6eb865b7773e8953e5acb955551ad1674 (diff)
downloadnextcloud-server-145db370d1e83978d0e575a60d7d61fbe1039cc4.tar.gz
nextcloud-server-145db370d1e83978d0e575a60d7d61fbe1039cc4.zip
Correctly round bytes when converted from human readable format
Instead of leave two decimal places which is confusing, round the byte values correctly to the closest byte.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/helper.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 0b1a26bbecd..807fa849637 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -308,7 +308,7 @@ class OC_Helper {
/**
* @brief Make a computer file size
- * @param string $str file size in a fancy format
+ * @param string $str file size in human readable format
* @return int a file size in bytes
*
* Makes 2kB to 2048.
@@ -338,7 +338,7 @@ class OC_Helper {
$bytes *= $bytes_array[$matches[1]];
}
- $bytes = round($bytes, 2);
+ $bytes = round($bytes);
return $bytes;
}