Correctly calculate lux values at Xiaomi Aqara Motion Sensor's illuminance channel

How to you convert the returned value of the transformation to a number? Please could you give an example how you calculate and compare this value in a rule.

@jimtng: I’ve tried to do so.
Therefore I’ve changed the script slightly to return a number instead of a string, but I’m even not sure if a number is returned.

function log10(val) {
return Math.log(val) / Math.log(10);
}

(function(i) {
var measuredValue = parseFloat(i);
if(isNaN(measuredValue)) return 1;
var illuminance = 10000*log10(measuredValue+1);
return illuminance;
})(input)

String MyItem “Illuminance” { channel=“zigbee:device:***_1_illuminance”[profile=“transform:JS”, function=“aqaraLuxCalc.js”]}

Number MyItem “Illuminance” { channel=“zigbee:device:***_1_illuminance”[profile=“transform:JS”, function=“aqaraLuxCalc.js”]}

The String Item will have the correct value, but the Number Item has always the value 1.0

Based on that post the JS Transformation always returns a String value.