I’m a new user on Uipath,and I’m facing my first problem trying to conver a string to a number.
I’m getting values from a DataTable into a variable (Heure_Minute_Actuelle_Row) :
row(2).ToString.Substring(9,2)+row(2).ToString.Substring(12,2) → Result is 1032 (as a string)
Then :
I try to convert as number what I get into Heure_Minute_Actuelle_Row (so 1032) by assigning in a new variable (Heure_Minute_Actuelle_Row_Number) → cint(Heure_Minuite_Row) and I get 0 as number
Could someone help on this topic how to convert this string into a number ?
row(2).ToString.Substring(9,2)+row(2).ToString.Substring(12,2) → Result is 1032 (as a string)
Then :
I try to convert as number what I get into Heure_Minute_Actuelle_Row (so 1032) by assigning in a new variable (Heure_Minute_Actuelle_Row_Number) → cint(Heure_Minuite_Row) and I get 0 as number
This should be: CInt(variable1)+CInt(variable2)
You need to convert each variable individually if they are strings, or it will use string concatenation.
You could also check if it’s a number before the conversion too like this: If(IsNumeric(variable1), CInt(variable1), 0) + If(IsNumeric(variable2), CInt(variable2), 0)