How to get integer input from user?

I tried this but how do i make it work? Input Field’s On End Edit says string so it doesn’t work. Is there a way to change a string to integer or fix my code?

public void GetInput(int number){ Debug.Log ("You entered " + number);

You can convert a string to an int:

You probably want to use the TryParse(…) version, as the user might not have typed in a number.