Search:

Type: Posts; User: helloworld922

Search: Search took 0.10 seconds.

  1. Replies
    7
    Views
    2,281

    Re: Help: Num to words

    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...
  2. Replies
    7
    Views
    2,281

    Re: Help: Num to words

    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...
  3. Replies
    7
    Views
    2,281

    Re: Help: Num to words

    The way you're calculating the tens digit isn't giving back the right value for large numbers.. try this:


    tens = (num/10) %10;
  4. Replies
    7
    Views
    2,281

    Re: Help: Num to words

    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...
Results 1 to 4 of 4