|
Banzai Newbie
Joined: 29 May 2003 Posts: 6 Location: USA
|
Posted: Sun Jun 15, 2003 1:36 am
Dividing vars to get a Percentage |
I have 2 vars, well actually 3.. @SpellsCast @SpellsSuccess @SpellsFailed
now I want to take these spells to figure out my Percentage of either Success or Failure. When I divide them using @SpellsFailed/@SpellsCast I get 0. Help?
Wherever you go, there you are. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Jun 15, 2003 2:40 am |
You get zero because the / division operator works only with integers (whole numbers). To get around this, multiply the dividend (@SpellsFailed) by 100 and then do the division.
li'l shmoe of Dragon's Gate MUD |
|
|
|
|
|