Explorar o código

11041 return power percentage with 1 decimal place

Arthur %!s(int64=3) %!d(string=hai) anos
pai
achega
826a1714c3
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  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()