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


Joined: 15 Mar 2004
Posts: 55
Location: USA

PostPosted: Tue Jun 29, 2004 5:45 pm   

eval stuff
 
Code
#SHOW {WHIFF - @bstwhiff/@bstotal}
#SHOW {HEADTURN - @bstheadturn/@bstotal}
#SHOW {SINGLE - @bstsingle/@bstotal}
#SHOW {DOUBLE - @bstdouble/@bstotal}
#SHOW {TRIPLE - @bsttriple/@bstotal}

Output
WHIFF - 3/18
HEADTURN - 3/18
SINGLE - 6/18
DOUBLE - 5/18
TRIPLE - 1/18

Desired output
WHIFF - 12%
HEADTURN - 12%
SINGLE - 12%
DOUBLE - 12%
TRIPLE - 12%

Want to divide to a 2 place decimal strip . and add %.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Tue Jun 29, 2004 6:29 pm   
 
You want 12% regardless of the actual values? Easy.
#SHOW {WHIFF - 12~%}
Smile Very Happy [:o)] Very Happy Smile

Seriously, percentages are easy. Multiply the dividend by 100 before dividing.
#SHOW {WHIFF - %eval( (100 * @bstwhiff)/@bstotal)~%}
Reply with quote
Ryntrax
Wanderer


Joined: 15 Mar 2004
Posts: 55
Location: USA

PostPosted: Tue Jun 29, 2004 6:35 pm   
 
duh thanks was thinkin to hard
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