I cant Multiply integer from Input Field


I have this script that gets an amount of gold and shows you how much money its worth if you convert it.

When the input field has a value it will store it as a string and the value of gold is 1000/gold bar. Then it should take the user input and multiple the 1000. However int.Parse() is not working… :confused:

if(inputText.text != null)
                string amountOfGold = inputText.text;
                int goldValue = 1000;
                int total = goldValue * int.Parse(amountOfGold);

                money.text = total.ToString();

                gold.text = amountOfGold;
                money.text = "$" + total;

Are you getting an error? My solution to this was checking if the input text is not equal to empty quotes. Checking if it is null wont check if the input field is empty