Change your method to
private string NumbersToWords(int number)
{
string word = "";
if (number == 8)
{
word = "Eight";
}
return word;
}
Previously you did not return a value, indicated by void
.
3
solved C# convert a number into words