[SOLVED] 'floatvalue' is not a member of 'java.lang.Number'

I have a problem with a rule / number conversion from Number to float:

The Item is

Number    Weather_Temperature1    "Außentemp (OWM) [%.1f °C]"                           <temperature> (gWeather_Chart)  ["CurrentTemperature"]    {weather="locationId=home, type=temperature, property=current"}

The rule (line 241):

logInfo("Weather", "Temperature1 (" + Weather_Temperature1.label + ") changed by " + String::format("%.2f", (Weather_Temperature1.deltaSince(now.minusMinutes(2))).floatValue()) + " degrees to " + String::format("%.2f", (Weather_Temperature1.state as DecimalType).floatvalue) + "degrees.")

I always get the warning

Rule 'Update max and min temperatures': 'floatvalue' is not a member of 'java.lang.Number'; line 241, column 228, length 51

The problem seems to be the part

String::format("%.2f", (Weather_Temperature1.state as DecimalType).floatvalue)

I have tried different solutions (using only state, Number instead of DecimalType, no floatvalue conversion, but without success.
Any help is appreciated.

You forget a () after your second floatvalue

logInfo("Weather", "Temperature1 (" + Weather_Temperature1.label + ") changed by " + String::format("%.2f", (Weather_Temperature1.deltaSince(now.minusMinutes(2))).floatvalue()) + " degrees to " + String::format("%.2f", (Weather_Temperature1.state as DecimalType).floatvalue()) + "degrees.")

I think I tried the second () already, with the same result, but will try again.

It’s floatValue() with a capital V
And a () after each

logInfo("Weather", "Temperature1 (" + Weather_Temperature1.label + ") changed by " + String::format("%.2f", (Weather_Temperature1.deltaSince(now.minusMinutes(2))).floatValue()) + " degrees to " + String::format("%.2f", (Weather_Temperature1.state as DecimalType).floatValue()) + "degrees.")

That was it!
Not easy to detect from the error message though…
Thanks for the help!

Coolio, please tick the solution, thanks