How to get a number from a UI input field

Long story short, I have a UI input field that I have set to only accept decimal inputs. When I go to access this input through code its type is string. How can I make this input a float or int so I can use math functions with it (add, subtract, multiply, divide, ect.)

Ps. I use C# for programming.

@Superspeedy
Here’s an example for you of how to retrieve data from UI inputfield;

InputField input;
int integer_Value_we_Want;

 integer_Value_we_Want = int.Parse(input.text); //for integer 
 integer_Value_we_Want = float.Parse(input.text); //for float
 integer_Value_we_Want = double.Parse(input.text); //for double

and so on…

not working

int.Parse() Does’nt work any more, you have to use TryParse()

` InputField input;
int number;

    int.TryParse(input.text, out int result); 
    number = result;`