|
Alcander Wanderer
Joined: 04 Aug 2001 Posts: 79 Location: USA
|
Posted: Thu Dec 20, 2007 8:44 pm
Word Numbers to actual Numbers |
Does anyone know a quick way to convert letter numbers to real numbers?
ie. Three = 3 or Three Hundred Thirty Three = 333
Help!
Alcander |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Thu Dec 20, 2007 8:54 pm |
I think there is a zMud script for the opposite conversion in the Finished Scripts forum, but can't recall ever actually seeing one for words to numbers.
I will write both up into good CMud code and put them in my Toolbox. It is not going to be done instantly though. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Thu Dec 20, 2007 10:47 pm Re: Word Numbers to actual Numbers |
Alcander wrote: |
Does anyone know a quick way to convert letter numbers to real numbers? |
Doesn't exist. All you can do is break up the string into sections and then turn each individual section into a number, perhaps calling the function recursively on each section and adding the result to a total. You also have to handle the teens seperately, which is annoying. |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Dec 21, 2007 1:28 am |
A new version of my Toolbox is up with this feature. These may still get optimized further and documented better, but they are working as far as my tests show.
As always PM me if you find a problem with my package. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|