Different Computers wrote:How can I round it off in the script? I'm starting to research this, but I worry about breaking the script.
If it doesn't want any decimal places, just convert it to an integer:
- Code: Select all
# Calculate the new value originally set at darknessValue = (sourceDevice.sensorValue-1000) * -0.1
darknessValue = int((sourceDevice.sensorValue-1000) * -0.1)
# Set the value of the destination variable
indigo.variable.updateValue(1021324478, value=str(darknessValue))