Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Alcander
Wanderer


Joined: 04 Aug 2001
Posts: 79
Location: USA

PostPosted: 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
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: 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.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net