Announcement

Collapse
No announcement yet.

Sorting Numbers with Words

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sorting Numbers with Words

    Ok... I've got a long list of movie titles and I want to make the list sort number titles intermixed with word titles... for example:

    "28 Days" would be with the T's for Twenty-eight
    "10" would also be with the T's for Ten
    etc

    Now... I'm sure that someone out there has written a routine that would convert a given number to it's word related counterpart... does anyone have it?

    -=> Jim! <=-

    ------------------
    -=> James "The Garf!" Davis! <=-
    Even if you think you don’t love mathematics,
    mathematics loves you. Don’t believe me?
    Solve the following for “i”.
    9x – 7i > 3(3x – 7u)

  • #2
    hi jim,

    we just had a major discussion on the numbers -> words issue.
    here's my idea of how to do it.
    http://www.powerbasic.com/support/pb...ad.php?t=24000

    my 2cents: "28 days" is the title. not "twenty-eight days"
    so, for my money, it sorts before "aardvarks gone mad".



    ------------------
    c'ya
    don
    [email protected]
    C'ya
    Don

    http://www.ImagesBy.me

    Comment


    • #3
      Thanks Don... Will mess around with it and see what I can figure out... not quite sure which version of Basic you've wrote that for thou.

      -=> Jim! <=-

      ------------------
      -=> James "The Garf!" Davis! <=-
      Even if you think you don’t love mathematics,
      mathematics loves you. Don’t believe me?
      Solve the following for “i”.
      9x – 7i > 3(3x – 7u)

      Comment


      • #4
        Jim, Don's function is written for being compiled as a Windows DLL. It should be no problem to convert it to PB/DOS.
        For sure there is to strip away ALIAS "fValue2Words" and EXPORT from the procedure header (they have to do with being a DLL). Some other feature specific of the Windows compilers seems to be used; now i got no time to look at it, but i'm sure that if you ask here about how do they can be translated, you'll get all the answers.

        ------------------
        Davide Vecchi
        [email protected]

        [This message has been edited by Davide Vecchi (edited October 31, 2003).]

        Comment


        • #5
          opps!!! sorry james... forgot you're working in dos (don't mind the header) i'll see if i can rustle up the dos version or cut this one back a bit.

          ok... got something (at least) that appears to be working in dos. give it a good test drive though.
          check it out in the source code forum. http://www.powerbasic.com/support/pb...ad.php?t=24046

          ------------------
          c'ya
          don
          [email protected]



          [this message has been edited by don schullian (edited october 31, 2003).]
          C'ya
          Don

          http://www.ImagesBy.me

          Comment

          Working...
          X