Convert string decimal to int

I have a string "246246.246" that I'd like to pass to the IConvertable interface, ToInt16, ToInt32, ToIn64. What is the best way to parse a string with decimal places to an integer?

This is a solution, but is there a better solution?

string value = "34690.42724";
Convert.ToInt64(Convert.ToDouble(value));
29
задан Uwe Keim 13 August 2018 в 11:00
поделиться