|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
"Four" to 4Has anyone ever run into a problem converting a text version of number to
it's whole number equivalent? If so, can someone please post an example in 2005 of how this is handled? ex. "Four" to 4 or "Forty-Five" to 45 Thank you "Bubba" <nate_p_sm***@hotmail.com> wrote in I believe you'll need to do text parsing. Perhaps with Regular Expressions?news:eaXwcdYDHHA.4832@TK2MSFTNGP06.phx.gbl: > Has anyone ever run into a problem converting a text version of number > to it's whole number equivalent? If so, can someone please post an > example in 2005 of how this is handled? > ex. "Four" to 4 or "Forty-Five" to 45 > Thank you Spam Catcher wrote:
> "Bubba" <nate_p_sm***@hotmail.com> wrote in Well, there will probably more involved then just regular expressions.> news:eaXwcdYDHHA.4832@TK2MSFTNGP06.phx.gbl: > > > Has anyone ever run into a problem converting a text version of number > > to it's whole number equivalent? If so, can someone please post an > > example in 2005 of how this is handled? > > ex. "Four" to 4 or "Forty-Five" to 45 > > Thank you > > I believe you'll need to do text parsing. Perhaps with Regular Expressions? And what about numbers with more than one text representation? For example, "1800" could be "eighteen-hundred" or "eighteen hundred" or "one thousand, eight hundred" or "one thousand and eight hundred" (of course the ", " and " and" are interchangable here).... ok that example was a little too simple. I'd have to try harder to come up with better ones. An interesting problem though. Would also be cool to translate Roman numerals. eg. NumConvert("IV") returns "Four" or "4" or "...." or "{4 in some other number system}"... Maybe if I have time later today I'll hack out something... ;) This has been done countless times in the last few decads and you should be
able to find examples on the Internet. You may or may not find one in VB.Net but you should be able to convert the few lines of Java, VB6 or what have you if you don't locate one in your language of choice. As for Roman Numeral conversion (somebody else posted about it) I would suggest reading a thread from 2003. It is a great esample of how one guy learned by constant refining of the process. Cor was in on it along with Fergus Cooney (whatever happened to him Cor?) and me along with a few others. Before you grab the code, read the thread and note that I have a completed set of functions near the end of the thread so you shouldn't grab the interim versions. Search for "Looping for user input in a textbox" or use this link: http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/f94daee1c21157f5/0f55f44be05b50b5?lnk=st&q=%22Looping+for+user+input+in+a+textbox%22&rnum=1#0f55f44be05b50b5 Show quoteHide quote "Bubba" <nate_p_sm***@hotmail.com> wrote in message news:eaXwcdYDHHA.4832@TK2MSFTNGP06.phx.gbl... > Has anyone ever run into a problem converting a text version of number to > it's whole number equivalent? If so, can someone please post an example > in 2005 of how this is handled? > ex. "Four" to 4 or "Forty-Five" to 45 > Thank you Tom,
I never knew what happened with Fergus, I have mailed him but it was a kind of dead address. I have asked this often off and online on Nick (Nak) with who he was often talking in this newsgroup. But never got an answer from Nick as well. (A very decent guy Nak these days). Cor Show quoteHide quote "Tom Leylan" <gee@iamtiredofspam.com> schreef in bericht news:ezMsY3aDHHA.4256@TK2MSFTNGP04.phx.gbl... > This has been done countless times in the last few decads and you should > be able to find examples on the Internet. You may or may not find one in > VB.Net but you should be able to convert the few lines of Java, VB6 or > what have you if you don't locate one in your language of choice. > > As for Roman Numeral conversion (somebody else posted about it) I would > suggest reading a thread from 2003. It is a great esample of how one guy > learned by constant refining of the process. Cor was in on it along with > Fergus Cooney (whatever happened to him Cor?) and me along with a few > others. Before you grab the code, read the thread and note that I have a > completed set of functions near the end of the thread so you shouldn't > grab the interim versions. > > Search for "Looping for user input in a textbox" or use this link: > http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/f94daee1c21157f5/0f55f44be05b50b5?lnk=st&q=%22Looping+for+user+input+in+a+textbox%22&rnum=1#0f55f44be05b50b5 > > > > "Bubba" <nate_p_sm***@hotmail.com> wrote in message > news:eaXwcdYDHHA.4832@TK2MSFTNGP06.phx.gbl... >> Has anyone ever run into a problem converting a text version of number to >> it's whole number equivalent? If so, can someone please post an example >> in 2005 of how this is handled? >> ex. "Four" to 4 or "Forty-Five" to 45 >> Thank you > >
IN Function ?
Visual Basic to be discontinued in 2008?? Recommendations - VB .Net courses/seminars another vb .net xml question 2 dimensional array question "Attempted to read or write protected memory" since 10 days... ADO.NET Rowfilter - between 2 dates How to deploye SQL 2005 Express with my application Call or Not Call Install errors during a Fix install |
|||||||||||||||||||||||