Re: [NEWBIE] Gold

From: George (greerga@circlemud.org)
Date: 11/10/98


On Tue, 10 Nov 1998, Roger Smith wrote:

>I'm not sure if this has been talked about before, but I was curious how
>to make it so a 'k' (thousand) and an 'm' (million) can be used after an
>amount of gold.
>
>> give 1k coins Joe
>
>(for all you math majors) is the same as
>
>> give 1000 coins Joe
>
>Any help?

It's easy, trust me.   Just iterate over the characters, starting at the
first, adding the values and multiplying by 10 every shift, unless it's a
character.  If you really need help, it might be in a copy of the arena
code on the FTP site, by Goon, called adv_atoi().  I can't remember if that
was in his public release or not.

--
George Greer, greerga@circlemud.org | Genius may have its limitations, but
http://mouse.van.ml.org/   (mostly) | stupidity is not thus handicapped.
http://www.van.ml.org/CircleMUD/    |                  -- Elbert Hubbard


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST