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
TheQ
Newbie


Joined: 08 Aug 2008
Posts: 1

PostPosted: Sat Aug 09, 2008 12:08 am   

Please help with formatting numbers
 
i'm trying to take this

Experience: 2507096

and turn it into this

Experience: 2,507,096

I simply want the comma's in the correct place. Easy to do ?


Thanks for any help offered.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Sat Aug 09, 2008 4:38 am   
 
You're looking for the %format function. For example
Code:
#SHOW %format("&.0n", 2507096 )
should do what you want.
_________________
Asati di tempari!
Reply with quote
ralgith
Sorcerer


Joined: 13 Jan 2006
Posts: 715

PostPosted: Fri Aug 15, 2008 12:28 am   
 
Or, if you're looking to do it via a trigger or a #SUB you can use:

#TRIGGER {Experience: (%n)} {#SHOW %format("&.0n", %1)}

Or the same with a #SUB.
_________________
CrossOver: Windows Compatibility on Mac and Linux CMUD Advocate
Reply with quote
Rappy
Wanderer


Joined: 15 Jul 2005
Posts: 96

PostPosted: Thu Sep 04, 2008 8:39 pm   
 
I use #PSUB for that

Code:

#TRIGGER {Experience: (%n)} {
  #PSUB {%format("&0.0n",%1)} %x1
}


-Rappy
_________________
Windows 11 Pro,
cMUD 3.34
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