CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Convert String

  1. #1
    Join Date
    Jan 2011
    Posts
    1

    Convert String

    Hello
    I have some trouble interpreting a string and I hope you can help me.
    I have to convert a string, or a word in a number. Like five hundred fifty in 550. I dont know exactly how to do it.
    I was thinking to try to analize each word, but this seems like a huge code. Or i was thinking that maybe you can check in a table, but then the table should be huge(numbers should go up to millions)
    Is there a smarter way? What do you suggest?
    Thank you very much

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,398

    Re: Convert String

    Quote Originally Posted by CD1 View Post
    ... Or i was thinking that maybe you can check in a table, but then the table should be huge(numbers should go up to millions)
    Yes, but not the all nembers between 0 and 1000000.
    only the following:
    1 to 20 ( 0 to 20)
    30, 40, 50, 60, 70, 80, 90
    100
    1000
    1000000
    Victor Nijegorodov

  3. #3
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Arrow Re: Convert String

    Here is a thread that may be helpful: http://www.codeguru.com/forum/showthread.php?t=506579. But be aware that this conversion probably can't be done in a few lines of code.

    HTH
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured