 |
Virus Wanderer
Joined: 29 Jun 2002 Posts: 69 Location: USA
|
Posted: 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 |
|
|
|
 |
fattony Apprentice
Joined: 27 Dec 2001 Posts: 105 Location: USA
|
Posted: 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 |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
 |
Virus Wanderer
Joined: 29 Jun 2002 Posts: 69 Location: USA
|
Posted: 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 |
|
|
|
 |
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sun Jul 28, 2002 5:38 pm |
Rounding can be done with this formula
%eval((@x/@y) + (((@x@y)*2)/@y))
LightBulb
Senior Member |
|
|
|
 |
|
|
|