Making a input field's value act like a int

Hi!

I need my input field to act like a int. I already got it working so it only accepts numbers but when I try and use it in code, it is like a string. I am using the new 4.6 beta UI. Do anyone know how I could do this?

Thanks

The input value of the InputField is always a string. All you need to do is use a cast. In C#"

int num_to_use = Convert.ToInt32(your_input.value);

It should be similar in JS.