Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f1c86928
Commit
f1c86928
authored
Dec 30, 2006
by
drumm
Browse files
#101757
by ChrisKennedy. 1 byte instead of 1 bytes.
parent
36fce2f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
f1c86928
...
...
@@ -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
));
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment