 |
Malleus Novice
Joined: 05 Jan 2003 Posts: 45 Location: USA
|
Posted: Thu Feb 20, 2003 9:28 pm
Simple Math Equation |
Im trying to write a simple table in an alias to show my attack statistics. I have something like this in alias 'attacks'
#SHOW Hard Hits:
#MATH testvar (@hitshard/@attacked)*100
#SHOW @testvar
I type the alias and it shows '0' all the time...i even switched the equation up a bit and it always shows '0'. (my variables arent 0 btw :) ) ...Any tips?
/ Malleus / |
|
|
 |
TonDiening GURU

Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Thu Feb 20, 2003 9:44 pm |
The issue is integer vs floating point(real numbers) math.
With integer math the result of a small number divided by a large
number yields always 0.
As you are looking for a general percentage do:
#MATH testvar (@hitshard*100/@attacked)
Ton Diening |
|
|
 |
Malleus Novice
Joined: 05 Jan 2003 Posts: 45 Location: USA
|
Posted: Fri Feb 21, 2003 5:48 am |
awesome, works....thanks alot :)
/ Malleus / |
|
|
 |
|
|