|
KurtDH Beginner
Joined: 14 Sep 2004 Posts: 17
|
Posted: Tue Nov 09, 2004 1:08 am
Decimal points |
This is the simple setup I have right now:
I have a trigger that counts the number of attacks I perform.
I have a trigger that counts the total damage I've done.
I have a trigger that divides total number of attacks into the damage, in order to find out the average damage per attack.
Is there anyway to show what this number is, in decimal form? I have the number being sent to a status window right now, but it's only showing me 4, 5, 6, etc. I would like to see 4.3, 4.4, 4.5, etc. Is this possible? |
|
|
|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Tue Nov 09, 2004 11:33 am |
Hi,
You can get decimal places by using the %float function. You can combine this with %format function to specify how many decimal places you want.
Somthing like
#MATH average %format(2,%eval(%float(@totaldamage)/(@attacks)))
This will give you 2 decimal places. |
|
|
|
KurtDH Beginner
Joined: 14 Sep 2004 Posts: 17
|
Posted: Tue Nov 09, 2004 8:30 pm |
I used that trigger. When totaldamage equaled 332, and attacks equaled 48, the number it was showing me was 6.00 instead of 6.91. What am I doing wrong?
|
|
|
|
mortie Wanderer
Joined: 26 Sep 2002 Posts: 73 Location: United Kingdom
|
Posted: Tue Nov 09, 2004 9:33 pm |
I just tested the above statement
#show %format(2,%eval(%float(332)/(48)))
and then with variables
#math testaverage %format(2,%eval(%float(@totaldamage)/(@attacks)))
I got 6.92 each time.
Might be an idea to recheck the trigger you have that works out the average. |
|
|
|
KurtDH Beginner
Joined: 14 Sep 2004 Posts: 17
|
Posted: Tue Nov 09, 2004 9:39 pm |
Indeed, a missing (.
Thanks. |
|
|
|
|
|