I have a string, "0.000" (or any similar string), that I would like to convert to a long. I am happy to "chop-off" anything after the decimal.
What is the best way to go about this?
I can convert to double and then to long, but I'm just wondering if there is an easier way. All the following statements throw exceptions:
long l3 = Convert.ToInt64(nrToConvert);
long l1;
long.TryParse(nrToConvert, out l1);
long l2 = long.Parse(nrToConvert);