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


Joined: 16 Nov 2008
Posts: 1

PostPosted: Sun Nov 16, 2008 1:54 am   

Adding decimals
 
I'm attempting to add two decimals in the following manner:

#IF bla, bla, bla {#AD limbdamage .8}
#IF bla, bla, bla {#AD limbdamage 1.2}

limbdamage is a variable which I need to track the total of these two #AD until it equals or exceeds 4. The problem I'm having is the zillon or so places after the decimal is messing things up. I need to add .8 + 1.2 and get 2 or 1.2 + 1.2 and get 2.4. I've tried the #math command and that seems to work when adding .8 but it pukes on adding 1.2 Help?
Reply with quote
Erasmus
Wanderer


Joined: 04 Aug 2004
Posts: 82
Location: Philadelphia

PostPosted: Sun Nov 16, 2008 3:18 am   
 
#VAR limbdamage %format(1,%eval(@limbdamage+0.8))
#VAR limbdamage %format(1,%eval(@limbdamage+1.2))
_________________
Erasmus
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