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
Aselarin
Beginner


Joined: 23 Jul 2005
Posts: 26

PostPosted: Sun Jul 31, 2005 12:13 am   

problem with decimals
 
hi, got a damage trigger to calculate % dmg of diff type
my math line is like this
#var test %format(1, %float( %eval(41239/(4365,0))))
then the test variable is empty

but when i do this
#var test %format( %float( %eval(41239/(4365,0))))
the test variable is 9,44765186309814

i want it reduced to only 1 decimal

anyone help me plz ?
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Jul 31, 2005 12:38 am   
 
You are using %float in the wrong spot perchance?, Also %float is not needed if one number is currently floating point.


#VAR test %format(1, %eval(%float(41239)/4365))
_________________
Zmud Support Library
Zmud Knowledge Base
Reply with quote
Aselarin
Beginner


Joined: 23 Jul 2005
Posts: 26

PostPosted: Sun Jul 31, 2005 12:42 am   
 
Still only returns the test variable empty
thx anyways
Reply with quote
Aarlot
Adept


Joined: 30 Dec 2003
Posts: 226

PostPosted: Sun Jul 31, 2005 12:54 am   
 
Hrmm... nexala's test works for me... 9.4 is what it gives
_________________
Everyone is entitled to their beliefs - until they die. Then only the truth matters.
Reply with quote
Aselarin
Beginner


Joined: 23 Jul 2005
Posts: 26

PostPosted: Sun Jul 31, 2005 12:59 am   
 
wonder if there is something wrong with my zmud then, running 7.13b
Reply with quote
Aselarin
Beginner


Joined: 23 Jul 2005
Posts: 26

PostPosted: Sun Jul 31, 2005 1:11 am   
 
have even tried it on 3 diff comp, and still don't work
%float only works on shit like 5/2, 3/2 etc
though only without the %format infront
Reply with quote
nexela
Wizard


Joined: 15 Jan 2002
Posts: 1644
Location: USA

PostPosted: Sun Jul 31, 2005 2:05 am   
 
Please be wary of your language here! My example was tested and worked for me

%float will return a floating point value I.E

4 become 4.0
and
4.0 will still be 4.0

I have noticed in your first example a coma? is that your default decimal seperator? Also post another example of how your script works now.
_________________
Zmud Support Library
Zmud Knowledge Base
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