vbMarkO Posted July 11, 2006 Posted July 11, 2006 Hi all, first let me say if this has already been asked and aswered feel free to point me to the resolved post, as I couldnt find it. Ok, what I am wanting to do may be a monumental task, but it is something I am looking at seriously adding to an application so here goes... you can tell me if I am crazy or if its not a big thing to worrry about. My question is How would I go about doing this... Lets take the number 1345 in a textbox in a labell it would say One Thousand three Hundred fourty five. OR the nunmber 13 in textbox gives a result of thirteen Or 320 Three Hundred twenty Just thinking of how to begin this really got the ole head to scratching LOL Just the same, perhaps the approach is not as dificult as it sounds Your thoughts? vbMarkO Quote Visual Basic 2008 Express Edition!
Leaders snarfblam Posted July 12, 2006 Leaders Posted July 12, 2006 That shouldn't be too difficult or monumental. The real work is in laying out the logic. If you manage to do it, maybe it could be something to stick in the Code Libarary. First of all, you can break things up into triplets of numbers. The millions/ten millions/hundred millions places have absolutely no bearing on the thousands/ten thousands/hundred thousands places, which, in turn, have no effect on the ones/tens/hundres places. The hardest part would be the ones/tens/hundreds. Once you work that out, you can use the same exact method for the thousands, and just tag on the word "thousand" (the same goes for millions). Hundreds should be pretty easy. Just a number followed by "hundred." In fact, the only hard part, really, is the last two digits where you have to deal with the whatevery-ty and whatever-teen. I would keep a list of 10 numbers ("zero", "one", "two", etc.), a list of 10 "teens" ("ten", "eleven", "twelve", "thirteen"...), and a list of 10 whateverties where the first two (for numbers 0 thru 19) would be ignored ("blah", "blah", "twenty", "thirty", "fourty"...). Quote [sIGPIC]e[/sIGPIC]
vbMarkO Posted July 12, 2006 Author Posted July 12, 2006 Great ideas, I will have code for posting to see the direction I am taking for sugestions as to make it more streamlined. vbMarkO Quote Visual Basic 2008 Express Edition!
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.