how to convert float to int c#

C#
Convert.ToInt32(float)float someFloat = 42.7f;
int someInt = (int)someFloat;               // 42
Source

Also in C#: