How to convert a string Number to int

Extracting a total amount from pdf and store in a string variable (Total).
image
I try to convert the string to float

Convert.ToSingle(Total).ToString()

and then convert to int
Convert.ToInt32(float).ToString()

It throw an error
image

How to Round off the Total number?

Hi @AbarnaKalaiselvam

How about the following?

Math.Round(CDbl(strInput)).ToString

Regards

1 Like

Thanks @fernando_zuluaga
Working!

1 Like

dtinput.Select(“Status =‘Hired’”).ToString()

using if condition
If the “Status” column in an excel contains “Hired” value.

it shows an an error datarow cannot covert to boolean

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.