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


Joined: 07 Apr 2003
Posts: 9
Location: USA

PostPosted: Tue Apr 08, 2003 6:53 am   

Number conversion
 
Sorry I keep bugging you guys, but is there a way to easily convert numbers from the format with commas in it to the format with just numbers in it and back? I figure there isn't and it can be done, but I thought I'd ask just in case.
Reply with quote
Wrudyn
Novice


Joined: 24 Mar 2003
Posts: 44
Location: USA

PostPosted: Tue Apr 08, 2003 9:44 am   
 
%replace(number, ",", "")
Removes all commas from a number.

%format("&0.0n", number)
Adds commas to a number.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Tue Apr 08, 2003 10:20 pm   
 
quote:

Sorry I keep bugging you guys, but is there a way to easily convert numbers from the format with commas in it to the format with just numbers in it and back? I figure there isn't and it can be done, but I thought I'd ask just in case.



If you are capturing a comma-delimited number, you can simply use %n instead of %d to match. %n even goes the extra mile by removing the commas from the variable it's stored in.

li'l shmoe of Dragon's Gate MUD
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