소스 검색

11041 return power percentage with 1 decimal place

Arthur 3 년 전
부모
커밋
826a1714c3
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      netbox/utilities/templatetags/helpers.py

+ 2 - 1
netbox/utilities/templatetags/helpers.py

@@ -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()