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


Joined: 09 Dec 2003
Posts: 4
Location: Canada

PostPosted: Sat Jan 10, 2004 4:03 am   

XP Counter
 
Here is an aliase I made to calculate xp/h..

#SAY XP gained : @exp Xp, Ratio: %eval(((@exp/@time)*60)/1000000),%eval(((( @exp/@time)*60)1000000)/10000) Mil xp/h.

Works fine excepts 2nd part of evaluate..
is answer is less then 10 itll display wrong..

Ex.
5.6 Mil xp/h. instead of 5.06 Mil xp/h.

any idea?

Luigi
Reply with quote
Danlo
Magician


Joined: 28 Nov 2003
Posts: 313
Location: Australia

PostPosted: Sat Jan 10, 2004 4:34 pm   
 
The modulus function you are using drops any preceding 0's of the remainder. I can't figure out any way to make sure it keeps the 0's, though.
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat Jan 10, 2004 6:00 pm   
 
The easiest solution is to drop the decimal calculation.

Some other solutions:
Calculate tenths instead of hundredths.
Calculate tenths and hundredths separately.
Use %if to put a 0 in front of the hundredths when it is less than 10.
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