Round cpu/pg like EVE does

To work around some fits where pyfa shows that items do not fit when they actually do
This commit is contained in:
DarkPhoenix
2019-02-13 13:14:18 +03:00
parent e0c389a643
commit cbd1a34c68
2 changed files with 6 additions and 3 deletions

View File

@@ -215,6 +215,8 @@ class ModifiedAttributeDict(collections.MutableMapping):
if force is not None:
if cappingValue is not None:
force = min(force, cappingValue)
if key in (50, 30, 48, 11):
force = round(force, 2)
return force
# Grab our values if they're there, otherwise we'll take default values
preIncrease = self.__preIncreases.get(key, 0)
@@ -268,7 +270,8 @@ class ModifiedAttributeDict(collections.MutableMapping):
# Cap value if we have cap defined
if cappingValue is not None:
val = min(val, cappingValue)
if key in (50, 30, 48, 11):
val = round(val, 2)
return val
def __handleSkill(self, skillName):

View File

@@ -1016,11 +1016,11 @@ class Fit(object):
@property
def pgUsed(self):
return self.getItemAttrOnlineSum(self.modules, "power")
return round(self.getItemAttrOnlineSum(self.modules, "power"), 2)
@property
def cpuUsed(self):
return self.getItemAttrOnlineSum(self.modules, "cpu")
return round(self.getItemAttrOnlineSum(self.modules, "cpu"), 2)
@property
def droneBandwidthUsed(self):