# VS 2010 Check If Value Has Decimals And If It Has Decimals, Remove Them?

May 19, 2010Dim y as integer

dim x as double = 125 / 60

y = Convert.ToInt32(x) 'removes decimals

That method works, it removes all the numbers after the decimal.

But, how to check if the double contains a decimal and if it has it, remove all the numbers after it?

I have tested all the possible solutions i can think of, but I always run into a lot of errors