Get Full text gives string as output. You will first need to convert to Int32. Do that for both your cases
use Convert.ToInt32(dt1) in assign to get it as an int variable
Then when both variables are int you perform the subtraction in assign activity and store the result in another int variable (or directly convert the result as string in the same assign)
Finally if if your result variable is already string then use that in message box. Else use .tostring to convert it to string from int
is it correct? when i try to change the var of “dt1” and “dt2” on the variables pane at the bottom of the studio the error says ‘ToInt32’ is not a member of ‘String’
ok, i’ve try "Int32.Parse(dt1), "Integer.Parse(dt1) it fail and the output was Input string was not in a correct format
i’m try to use “CInt(dt1)” and the output is Cannot convert Generic Value to System.Int32
You will get this error: “Conversion from string “” to type ‘Integer’ is not valid”
because either the value that was extracted was empty or the string is not in a number format. If it is in a correct Double format, it will still work… it just needs to be a number.
It is good practice to check the string if it is a number before conversion. You can check this using the condition: IsNumeric(dt1)
But, you also want to make sure your extraction of the string is working as intended so it’s not a coding issue causing this.
Sometimes to avoid clutter, I will use an inline If condition which would look like this: If(IsNumeric(dt1), Convert.ToInt32(dt1), 0) + If(IsNumeric(dt2), Convert.ToInt32(dt1), 0)
so, it uses a Zero if the value is not a number. Also, keep in mind that 123.000,00 is not in the correct number format since the comma and decimal are in opposite positions, but like for me I don’t convert numbers in that format much since I’m used to the US formats.
can you give me another solution to detect the format number? i’ve tried using “Get OCR Text”, and it works by add DeniedCharacters in properties (,) and set profile to scan but the problem it doesn’t accurate 100% and every number have different scale to detect