1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Closes #8232: Add color show full 100% utilization (#8816)

* Closes #8232: Add color show full 100% utilization

* change rounding

* change rounding

* fix hard code html

* format
This commit is contained in:
tranthang2404
2022-03-25 20:52:13 +07:00
committed by GitHub
parent 421f5a03aa
commit 1278429518
4 changed files with 9 additions and 7 deletions

View File

@@ -412,7 +412,7 @@ class Rack(PrimaryModel):
available_units.remove(u)
occupied_unit_count = self.u_height - len(available_units)
percentage = int(float(occupied_unit_count) / self.u_height * 100)
percentage = float(occupied_unit_count) / self.u_height * 100
return percentage