How does the AQ_RX_c1 get populated? If it uses a binding that can use transformations you can remove the mV or pH before it gets to the Item in the first place and only require the Number Item.
I think this is a case where you will get a better solution if you provide more context (full Item config, relevant rules, and a better explanation of what you are trying to achieve). I can just tell you how to do what you ask but I’m almost certain there are better ways that do not even require the second Item or Rules to do it.
String AQ_RX "AQRX [%s]" ( AQ ) { http="<[http://192.168.1.30/profilux.json:30000:JSONPATH($.components.sensors[003].actual)]" }
Then it is beeing trimmed in a rule
when
Item Switch_dummy changed
then
var String redoxstr = AQ_RX.state.toString().replace("mV", "") // Cut off unit
AQ_RX_c1.postUpdate(redoxstr) // Send String C1 Variable to item
Now it is trimmed but I need a number for additional calculations based on the number
OK, in that case since you are already using a transformation you will not be able to easily do this all in a transformation (unless you are good with JavaScript).
So once you have extracted just the number just send it to the Number Item.
AQ_RX_c2.postUpdate(redoxstr)
Assuming the string in redoxstr is a valid Number, the parsing of the String to a Number will be handled for you. If it isn’t a valid number you will need to do some additional manipulations to the String (e.g. trim to remove white space) to convert it into a valid number.
FYI, in case you don’t need/want the second item, you could always just convert the redoxstr variable for use in the rule with Double::parseDouble(redoxstr).