Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15403860
D10631.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10631.id.diff
View Options
diff --git a/src/utils/viewutils.php b/src/utils/viewutils.php
--- a/src/utils/viewutils.php
+++ b/src/utils/viewutils.php
@@ -71,7 +71,7 @@
/**
* Format a byte count for human consumption, e.g. "10MB" instead of
- * "10000000".
+ * "10485760".
*
* @param int Number of bytes.
* @return string Human-readable description.
@@ -79,8 +79,7 @@
function phutil_format_bytes($bytes) {
return phutil_format_units_generic(
$bytes,
- // NOTE: Using the SI version of these units rather than the 1024 version.
- array(1000, 1000, 1000, 1000, 1000),
+ array(1024, 1024, 1024, 1024, 1024),
array('B', 'KB', 'MB', 'GB', 'TB', 'PB'),
$precision = 0);
}
@@ -107,11 +106,11 @@
}
$scale = array(
- 'k' => 1000,
- 'm' => 1000 * 1000,
- 'g' => 1000 * 1000 * 1000,
- 't' => 1000 * 1000 * 1000 * 1000,
- 'p' => 1000 * 1000 * 1000 * 1000 * 1000,
+ 'k' => 1024,
+ 'm' => 1024 * 1024,
+ 'g' => 1024 * 1024 * 1024,
+ 't' => 1024 * 1024 * 1024 * 1024,
+ 'p' => 1024 * 1024 * 1024 * 1024 * 1024,
);
$bytes = (float)$bytes;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 19, 5:09 AM (3 d, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7699275
Default Alt Text
D10631.id.diff (1 KB)
Attached To
Mode
D10631: Use normal human units, not "correct" SI units, when parsing MB/GB etc
Attached
Detach File
Event Timeline
Log In to Comment