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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Fri Oct 25, 2002 7:13 pm   

Removing "," from a monetary output
 
What would be the best way to remove the commas from and output such as 4,056,287?

What im trying to do is make an easy way to deposit all my money in the bank. I'd like to do it by right clicking the amount in my prompt, and using deposit %selword.

Here's the prompt:

<1618/1618 1631/1631 890 (-1000)()(S)(4,056,287)(night)(2500)>

For which i made the following prompt trigger:

Pattern: ~<%d/%d %d/%d %d ~(%d~)~(*~)~(*~)~((*)~)~(%w~)~(%d~)~>

Then i tried using %subchar %1, ",","" in Value. but it sends 4056287 to the mud. And i'm not clear enough on #SUB to understand how to apply it here either. Thanks very much for any help
Reply with quote
Troubadour
GURU


Joined: 14 Oct 2000
Posts: 556
Location: USA

PostPosted: Fri Oct 25, 2002 7:30 pm   
 
In your pattern use %n instead of %d. It'll capture numbers with commas or signs.

Otherwise, use the %replace function:

#VAR gold %replace(%selword, ",","")

replaces all commas in the selected text with nulls.

The %remove function would only remove the first instance, not all instances.

Troubadour
(Win 98, Pentium III, 550 MHz)
Reply with quote
doomfyre
Apprentice


Joined: 03 Jan 2002
Posts: 152
Location: USA

PostPosted: Fri Oct 25, 2002 8:13 pm   
 
Thank you, Troubador. Something interesting that i found out, is that when i used the %n wild card to assign the @gold variable, was that it removed the "," all by itself. So, all i had to do was put deposit @gold in my right click menu. I don't even have to right click the gold in the prompt.

Learning new things rules!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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