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


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Sun Jul 28, 2002 1:08 am   

Numbers and More Numbers
 
Ok, I am doing a center function. What I need to know is, is there a round function? Or a function that returns a decimal? Cause if I do %eval(5/2) I get 2, not 2.5 How do i get 2.5?

Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
fattony
Apprentice


Joined: 27 Dec 2001
Posts: 105
Location: USA

PostPosted: Sun Jul 28, 2002 1:33 am   
 
Make at least one of the numbers a floating point.

#show %eval(5/2) --> will display 2.

But

#show %eval(%float(5)/2) --> will display 2.5.

Fat Tony
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jul 28, 2002 4:21 am   
 
quote:

Make at least one of the numbers a floating point.

#show %eval(5/2) --> will display 2.

But

#show %eval(%float(5)/2) --> will display 2.5.

Fat Tony



%float() does not exist in ZMud at this time (as it applies to version 6.16).

li'l shmoe of Dragon's Gate MUD
Reply with quote
Virus
Wanderer


Joined: 29 Jun 2002
Posts: 69
Location: USA

PostPosted: Sun Jul 28, 2002 5:42 am   
 
Hmm...Im using 6.32 and float is in there. It works great, thanks FT


Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sun Jul 28, 2002 8:42 am   
 
quote:

Hmm...Im using 6.32 and float is in there. It works great, thanks FT


Richard Powell
Mux Alias: Virus
2796 Wizard Staff
64.89.10.1 port 2796
Rich@gigdev.com



6.32 is a beta version (the latest one), so any questions about a beta version feature should go into the Beta Forum. If you don't have access to it, click the FORUMS menu at the top of the Zuggsoft site, scroll down to ZMud Beta Forum Application (or whatever the link text may be), click said link, and then click the OK/I accept button that appears. Instant access.

li'l shmoe of Dragon's Gate MUD
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sun Jul 28, 2002 5:38 pm   
 
Rounding can be done with this formula
%eval((@x/@y) + (((@x@y)*2)/@y))

LightBulb
Senior Member
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