Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
cta
Commits
27604c44
Commit
27604c44
authored
Sep 02, 2014
by
Sebastien Ponce
Browse files
Fixed corner case of printPercentage when the given arguments are None
parent
f45d77bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
hsmtools/castor_tools.py
View file @
27604c44
...
...
@@ -578,8 +578,10 @@ def nbToDataAmount(n):
def
printPercentage
(
portion
,
total
):
'''converts portion/total couple to a percentage of completion'''
if
total
==
0
:
if
total
==
0
or
total
is
None
:
return
'N/A'
if
portion
is
None
:
portion
=
0
perc
=
portion
*
100.0
/
total
return
"%.1f %%"
%
perc
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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