JS Transformation of Number:Power

As an alternative solution that perhaps some people find less error prone:

When it comes to scaling plain numbers from modbus and converting them to UoM (numbers with associated unit), you can use modbus:gainOffset profile. This can be also to write numbers to modbus (with units converted accordingly).

Simply set the profile’s gain parameter to 24 W.

There is a full example using textual config in docs: Modbus - Bindings | openHAB