Commit f1c86928 authored by drumm's avatar drumm

#101757 by ChrisKennedy. 1 byte instead of 1 bytes.

parent 36fce2f0
......@@ -989,16 +989,18 @@ function parse_size($size) {
* A translated string representation of the size.
*/
function format_size($size) {
$suffix = t('bytes');
if ($size >= 1024) {
$size = round($size / 1024, 2);
$suffix = t('KB');
if ($size < 1024) {
return format_plural($size, '1 byte', '@count bytes');
}
if ($size >= 1024) {
else {
$size = round($size / 1024, 2);
$suffix = t('MB');
$suffix = t('KB');
if ($size >= 1024) {
$size = round($size / 1024, 2);
$suffix = t('MB');
}
return t('@size @suffix', array('@size' => $size, '@suffix' => $suffix));
}
return t('@size @suffix', array('@size' => $size, '@suffix' => $suffix));
}
/**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment