All the code you had before handled positive numbers, correct? So, if it's negative, simply add "negative" to the beginning of the string and do the num-word stuff on the absolute value of the number...
Type: Posts; User: helloworld922
All the code you had before handled positive numbers, correct? So, if it's negative, simply add "negative" to the beginning of the string and do the num-word stuff on the absolute value of the number...
I would check the negative part first:
if (num < 0)
{
str += "Negative "; // or what-ever the string your returning is called
num = -num; // get positive num so rest of code works...
The way you're calculating the tens digit isn't giving back the right value for large numbers.. try this:
tens = (num/10) %10;
Mmm... I had code to do just this somewhere :P
In your code where you're checking tenz, you need to add extra code when tenz == 1. It should return the appropriate string depending on what the...