|
Aselarin Beginner
Joined: 23 Jul 2005 Posts: 26
|
Posted: Sun Jul 31, 2005 12:13 am
problem with decimals |
hi, got a damage trigger to calculate % dmg of diff type
my math line is like this
#var test %format(1, %float( %eval(41239/(4365,0))))
then the test variable is empty
but when i do this
#var test %format( %float( %eval(41239/(4365,0))))
the test variable is 9,44765186309814
i want it reduced to only 1 decimal
anyone help me plz ? |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sun Jul 31, 2005 12:38 am |
You are using %float in the wrong spot perchance?, Also %float is not needed if one number is currently floating point.
#VAR test %format(1, %eval(%float(41239)/4365)) |
|
|
|
Aselarin Beginner
Joined: 23 Jul 2005 Posts: 26
|
Posted: Sun Jul 31, 2005 12:42 am |
Still only returns the test variable empty
thx anyways |
|
|
|
Aarlot Adept
Joined: 30 Dec 2003 Posts: 226
|
Posted: Sun Jul 31, 2005 12:54 am |
Hrmm... nexala's test works for me... 9.4 is what it gives
|
|
_________________ Everyone is entitled to their beliefs - until they die. Then only the truth matters. |
|
|
|
Aselarin Beginner
Joined: 23 Jul 2005 Posts: 26
|
Posted: Sun Jul 31, 2005 12:59 am |
wonder if there is something wrong with my zmud then, running 7.13b
|
|
|
|
Aselarin Beginner
Joined: 23 Jul 2005 Posts: 26
|
Posted: Sun Jul 31, 2005 1:11 am |
have even tried it on 3 diff comp, and still don't work
%float only works on shit like 5/2, 3/2 etc
though only without the %format infront |
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Sun Jul 31, 2005 2:05 am |
Please be wary of your language here! My example was tested and worked for me
%float will return a floating point value I.E
4 become 4.0
and
4.0 will still be 4.0
I have noticed in your first example a coma? is that your default decimal seperator? Also post another example of how your script works now. |
|
|
|
|
|