How can i change text number on number format ? because i need to compare numbers and sometime its a text and sometimes is a numbers
Hey,
it’s depends on which format do you need, you can use:
Integer: CInt, Convert.ToInt32, and Integer.Parse
ex.
Cint(Value)
Integer.Parse(Value)
Cint(“3”)
Integer.Parse(“3”)
Double: CDbl, Convert.ToDouble, and Double.Parse
ex.
Cdbl(Value)
Double.Parse(Value)
Cdbl(“0.2”)
Double.Parse(“0.2”)
i need to convert text to number
what format is “double”? which one i need to chose ?
Hi @Soudios
=> Use For each Row in DataTable to iterate through the rows.
=> Inside the loop give the condition in assign activity.
CurrentRow("column name")=Decimal.Parse(CurrentRow("column name").ToString)
=> Use Write Range Workbook to write the datatable back to excel.
Hope it helps
i need something easier than that
Take a look to this code and try to adjust it to your process
textToNumber.zip (2.5 KB)
Can you provide fully expression which you are assigning to ‘double’ variable?
Also provide screenshot of the variable types.
use tostring method:
Out_MarginExcel.ToString
Hi @Soudios
-
Convert Text Number to Number
CDbl(“TextNumber”) -
Number To Text
Number.ToString OR (Number).ToString
Hope it will helps you
Cheers!!
Hi @Soudios
Can you try the below sample
CDbl(Input.Replace(" ",""))
There is a space in between numbers that’s why it is getting error
Cheers!!
the number is not exact, its missing “,”
245664,20
its not working its still missing “,” on the number
it still not working the 2 text variable are same but the bot consider they are not