i thing that i have tried all, but it do not work till now.
Please advice me how to work with numbers from items?
I would like to format temperature to whole numbers without commas.
Group:Number:AVG gMaxAVGTemperature "Average Temperature [%.1f °C]" // e.g. "21.3 °C
rule "Status. Clima"
when
Item gMaxAVGTemperature changed
then
logInfo("loggerName", String.format("%,.0f", gMaxAVGTemperature.state))
end
These do not works:
String.format("%,.0f", gMaxAVGTemperature.state.intValue)
String.format("%,.0f", gMaxAVGTemperature.state as Number)
String.format("%,.0f", gMaxAVGTemperature.state as DecimalType)
String.format("%,.0f", gMaxAVGTemperature.state.toString.IntValue)
and so on..
2020-01-28 19:03:40.004 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Status. Clima': d != org.eclipse.smarthome.core.library.types.DecimalType
2020-01-28 19:07:28.003 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Status. Clima': d != org.eclipse.smarthome.core.library.types.DecimalType
I have a question to this…how can i make a percent-sign appear on the label? For Example: [%.1f °C] displays degree celsius, but [%.1f %] leads to error…I want to display the humidity in percent…