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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Tech
GURU


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

PostPosted: Sun Oct 22, 2006 8:31 pm   

[1.11] %format with the d option.
 
Admitted I might be using it wrong, the the d (decimal) option %format doesn't seem to be working.


Code:
#VAR XP  256740
#show XP: @XP   XP: %format("&8.0d", @XP)  XP: %format("&8.0n", @XP)

outputs
Code:
XP: 256740 XP:  XP:  256,740


[Edit:]
I must be using it wrong because it doesn't work in zMUD 7.21 either. I basically want to the number to be displayed fixed width, right justified without the commas of the 'n'. The workaround I'm using is to use
XP: %format("&8.0f", @XP) instead.
_________________
Asati di tempari!
Reply with quote
Tech
GURU


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

PostPosted: Sun Oct 22, 2006 8:42 pm   
 
As an aside, the left justify option (i.e. XP: %format("&-8.0d", @XP) doesn't seem to maintain the padding in CMUD.
_________________
Asati di tempari!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Oct 22, 2006 9:05 pm   
 
hmm, worked for me in ZMud. Try using % instead of &? Noticed it wasn't working in CMud, though, and I believe I reported it already.
_________________
EDIT: I didn't like my old signature
Reply with quote
Tech
GURU


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

PostPosted: Sun Oct 22, 2006 10:58 pm   
 
% didn't work for me either.
_________________
Asati di tempari!
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Mon Oct 23, 2006 1:59 am   
 
Yeah, I worded my response wrong. Meant to say it completely doesn't work in CMud, but that % might work in ZMud where & wasn't.
_________________
EDIT: I didn't like my old signature
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum 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