change format to not have 2.5000000000001 strings in states
Posted: Tue Oct 03, 2017 11:07 pm
suggestion to the authors or Matt,Jay:
with adding decimalPlaces :
and adding decimalplaces to each of the calls with numbers to e.g.:
Karl
with adding decimalPlaces :
- Code: Select all
def _addToBatchStatesChange(self, dev, key="", value="",decimalPlaces=""):
devId = dev.id
if devId not in self.batchStatesUpdate:
self.batchStatesUpdate[devId] = []
if decimalPlaces == "":
self.batchStatesUpdate[devId].append({"key":key, "value":value})
else:
self.batchStatesUpdate[devId].append({"key":key, "value":value,"decimalPlaces":decimalPlaces})
return
and adding decimalplaces to each of the calls with numbers to e.g.:
- Code: Select all
self._addToBatchStatesChange(self.tempList[sensor], key=u"currentMonthTotal", value=currentMonthTotal,decimalPlaces=2)
Karl