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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Jun 26, 2010 7:42 am   

%format
 
From this link

I don't see an option to give a number commas without giving it decimals at the end as well. Why is that? I'd like to format my numbers to be like so:
1,000
13,000

etc...

without having to worry about trying to cut off a:
1,000.00

.00 at the end.
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Sat Jun 26, 2010 1:51 pm   
 
#SHOW %format("&.0n",1000)
#SHOW %format("&.0n",13000)

It is there in the documentation. It just isn't that plain in the example given.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
chamenas
Wizard


Joined: 26 Mar 2008
Posts: 1547

PostPosted: Sat Jun 26, 2010 2:09 pm   
 
Thanks, Arminas. So would I need to use a .0 in there to tell it to NOT use decimals?
_________________
Listen to my Guitar - If you like it, listen to more
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Sun Jun 27, 2010 6:40 pm   
 
Because .0 is telling it to use 0 places after the decimal. The default is to use 2 places after the decimal, I believe. That is not unusual in programming languages.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD 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