Round rack power utilization to nearest 0.1%

Fixes #12838
This commit is contained in:
Brian Candler 2023-06-08 14:31:46 +01:00
parent 9fb52be85c
commit 01d9e0afb6

View File

@ -466,7 +466,7 @@ class Rack(PrimaryModel, WeightMixin):
powerport.get_power_draw()['allocated'] for powerport in powerports
])
return int(allocated_draw / available_power_total * 100)
return round(allocated_draw / available_power_total * 100, 1)
@cached_property
def total_weight(self):