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
RobMacAF
Apprentice


Joined: 09 Jun 2002
Posts: 186
Location: USA

PostPosted: Tue Mar 01, 2005 10:35 am   

Getting a decimal
 
I have been crashing my brain cells together trying to get the scripting to return a decimal. I have tried the following...

Keep in mind 63/2 is 31.5

#MATH 63/2

#VAR Number %round(63)
#MATH @Number/2

#MATH %round(63/2)

I also tried putting %int and %float in those spots.

Can someone PLEASE point out my stupidity for me? Thanks alot!
Reply with quote
misterbalrog
Apprentice


Joined: 26 Oct 2004
Posts: 108

PostPosted: Tue Mar 01, 2005 12:28 pm   
 
To get decimals, use decimals.

using %eval(63.0/2.0) gives 31.5

additionally, if you wish to turn an integer into a float, use %float..

%eval(%float(62)/%float(2)) gives 31.5 aswell...
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