How to Convert double to int in C# (With safeguards)