Alex Rivera | Logout

How could I convert data from string to long in c#

Asked 2011-06-13T12:19:06.223
150

How could i convert data from string to long in C#?

I have data

String strValue[i] ="1100.25";

now i want it in

long l1;
Edit
Report

1 Answer

7

You won't be able to convert it directly to long because of the decimal point i think you should convert it into decimal and then convert it into long something like this:

String strValue[i] = "1100.25";
long l1 = Convert.ToInt64(Convert.ToDecimal(strValue));

hope this helps!

answered 2011-06-13T12:41:24.393

Your Answer