Are you doing this to convert units? If so, using Units of Measurement will be by far the easiest. Otherwise you need to parse those numbers and use java.lang.Math.pow().

val power_ac = new BigDecimal(transform("JSONPATH", "$.c_power_ac", (rawMessage.state).toString))
val power_ac_scale = new BigDecimal(transform("JSONPATH", "$.c_power_ac_scale", (rawMessage.state).toString))
val result = power_ac * java.lang.Math(10, power_ac_scale.doubleValue)

val current = new BigDecimal(transform("JSONPATH", "$.c_current", (rawMessage.state).toString))
val current_scale = transform("JSONPATH", "$.c_current_scale", (rawMessage.state).toString)
val current_result = current * java.lang.Math(10, current_scale.doubleValue)

The method or field java is undefined(org.eclipse.xtext.diagnostics.Diagnostic.Linking)
The method or field doubleValue is undefined for the type String(org.eclipse.xtext.diagnostics.Diagnostic.Linking)

Of course result should be a float measurement.
Thanks.

I havenâ€™t use OH 2.5.4 in over two years now. 2.5.4 is no longer supported so the best youâ€™re going to get is vague memories. If it doesnâ€™t work If you want to stay on such an old and unsupported version of any software, you should be changing anything on it anyway.

But there doesnâ€™t need to be any imports. Both BigDecimal and Math are imported by default. And we used the full name of java.lang.Math anyway.

Again, like I said above,

That tells you what the problem is.

val current_result = current * java.lang.Math.pow(10, current_scale.doubleValue)

If it still complains about the doubleValue, . That works for me.

But also, if you are relying purely on VSCode errors you will never get these lines to not show an error. They are not real errors. Just a limitation of the openHAB plug-in.