Help - Search - Members - Calendar
Full Version: Nexus Math
Achaea's Forums > Off-Topic > Tech Support
Mickelson
Apparently, decimals don't work in #math, at least not straightforward.

Like this:

SYNTAX:
temp

SCRIPT:
#math temp $temp 10.5
#echo #temp


says:

999h, 999m, 999e, 999w ex-#set temp 1
Variable "temp" set to: 1
999h, 999m, 999e, 999w ex-temp
105
temp
10505
temp
1050505
temp
105050505
temp
10505050505
temp
-105


And so on and so forth. So, 10.5 is actually scripted as 105.

Really, I can just labor it out and do some complex algebra with percentages and whatnot, but is that really necessary? Or am I missing something? blink.gif
Alascia
No idea why it's like this, probably something to do with whatever code it is Nexus scripts with.

It's easily worked around though, just multiply by the decimalised number * 100 instead, then divide by 100 at the end.

eg.

instead of: #math temp (50 * 1.5)

do: #math temp (50 * 150) / 100
Irion
A pro of the flash client is the ability to do math with decimals. However, you really don't need decimals for anyway.
Jaybles
What you are doing currently:

#set temp $temp 10.5

just appends to the end of the string, temp. I guess that Nexus doesn't handle floating point numbers as well as other fully fledged clients (like Mudlet) in #set.

Using #math would probably solve your problem.

#math temp ($temp *10.5)
or
#math temp (($temp * 105)/10)

But seriously, if you require more complex functionality, Mudlet's a good client (and its free!).
Jonathin
just use the fraction format.

$temp*(11/2)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.