Hello
I have a string (from serial) like this:
>DATA:0001:01:0168
Where the last value 0168
in a Hex and I want to convert it to integer in decimal (shoud be 360
)
How I can to do it?
Thanks.
Hello
I have a string (from serial) like this:
>DATA:0001:01:0168
Where the last value 0168
in a Hex and I want to convert it to integer in decimal (shoud be 360
)
How I can to do it?
Thanks.
Should be able to do something like this:
data = "0168"
value = Integer.parseInt(data, 16)
I haven’t tried this in a script, however.
Hi namraccr,
thank you for your tip.
The rigth syntax for rules is:
import java.lang.*
Integer::parseInt(data, 16)