Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mihkel Putrinš
panustaja
Commits
f89c9011
Commit
f89c9011
authored
Nov 23, 2015
by
Mihkel Putrinš
Browse files
===
parent
397e497d
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/bytesToSize.js
View file @
f89c9011
var
bytesToSize
=
function
bytesToSize
(
bytes
)
{
if
(
bytes
===
undefined
)
bytes
=
0
var
sizes
=
[
'
B
'
,
'
KB
'
,
'
MB
'
,
'
GB
'
,
'
TB
'
]
if
(
bytes
==
0
)
return
'
0 B
'
if
(
bytes
==
=
0
)
return
'
0 B
'
try
{
var
i
=
parseInt
(
Math
.
floor
(
Math
.
log
(
bytes
)
/
Math
.
log
(
1024
)))
var
decimals
=
Math
.
max
(
0
,
i
-
1
)
...
...
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