Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ICS Control System Infrastructure
Netbox
Commits
826a1714
Commit
826a1714
authored
Dec 01, 2022
by
Arthur
Committed by
Jeremy Stretch
Dec 01, 2022
Browse files
11041 return power percentage with 1 decimal place
parent
fb407e90
Changes
1
Hide whitespace changes
Inline
Side-by-side
netbox/utilities/templatetags/helpers.py
View file @
826a1714
...
...
@@ -138,7 +138,8 @@ def percentage(x, y):
"""
if
x
is
None
or
y
is
None
:
return
None
return
round
(
x
/
y
*
100
)
return
round
(
x
/
y
*
100
,
1
)
@
register
.
filter
()
...
...
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