I have a morning announcement that announces the high/low temperatures of the day and tomorrow.
Right now the TTS sound stupid when there are decimal values like 13.2 degrees. I would like this value to be rounded to 13 degrees before I add it to the text string. I’m not so good at coding so I have no idea how to do this using lua.
I would greatly appreciate it if someone could help me with the lua code, here is how I get to values to a variable now:
Can I just declare the local variable as integer somehow? It would be nice ofcourse if a value say 13.8 would be rounded to 14 instead of just leaving out the decimal value.
local OwTempTodayHigh= luup.variable_get(TEMP_SID, “TodayMaxTemp”, 548)
local OwTempTodayLow= luup.variable_get(TEMP_SID, “TodayLowTemp”, 548)
local OwTempTomorrowHigh= luup.variable_get(TEMP_SID, “TomorrowHighTemp”, 548)
local OwTempTomorrowLow= luup.variable_get(TEMP_SID, “TomorrowLowTemp”, 548)