I can’t seem to find a solution to the following problem: how can I find out how many decimal places a number (assigned to a variable from Excel) has? The number needs to have exactly two decimal digits, if it has more, UiPath is supposed to throw an error.
Example (in a if condition):
Number 20,33 → then it’s correct and the process continues
Number 20,331 → else process should be stopped
I am not sure whether you are referring the “.” with “,”. Anyway we can use the string manipulations to find out how many decimals there in that string. I assume the value mentioned are string type. use below expression for if condition.
YourValue.split(","c)(1).length = “2” pls proceed or throw exception using throw activity. please let me know if you need any additional help. thanks.