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
Atreides_096
Wanderer


Joined: 21 Jan 2005
Posts: 99
Location: Solvang, CA

PostPosted: Sun Apr 24, 2005 1:49 pm   

Parsing large numbers in alias'd script output
 
Hi all, I'm looking for a way to parse large numbers (1,000+) in script output. For eample, if I have an alias to show total gold spent on potions, and the output is:

I have spent 1123456 gold on potions.

I'd want it to output:

I have spent 1,123,456 gold on potions.

I assume it's some simple % command I am missing to format the variable containing the number... But I cannot find it in the helps. Thanks in advance![/code]
Reply with quote
megamog75
Enchanter


Joined: 20 Nov 2002
Posts: 627
Location: USA

PostPosted: Sun Apr 24, 2005 2:20 pm   
 
check out %format in the help files it has a detailed explination for you

this will work up till 99,999,999,999

%format("&10.0n",123456)

I use %format("&3.0n",123456)
_________________
megamog75 Smile
I will do this.Nothing in my life matters except this.No moment in my life exists except this moment.I am born in this moment, and if I fail, I will die in this moment. Raistlin Majere
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Apr 24, 2005 2:24 pm   
 
#SAY %format("&0.0n",@varWithNum)

This basicly just tells it not to pad and not to show decimal places
_________________
Zmud Support Library
Zmud Knowledge Base
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