You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by ZK <st...@gmail.com> on 2011/11/09 17:29:43 UTC

Re: Adding two numeric variables with decimal places

Hi,
I think your issue is; you need to convert your variable values to REAL
numbers




ZK

--
View this message in context: http://jmeter.512774.n5.nabble.com/Adding-two-numeric-variables-with-decimal-places-tp4977855p4978250.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Adding two numeric variables with decimal places

Posted by apc <ap...@apc.kg>.
Try doubleSum function from here:
http://code.google.com/p/jmeter-plugins/wiki/Functions

-----
--
Andrey Pohilko
JP@GC Maintainer
--
View this message in context: http://jmeter.512774.n5.nabble.com/Adding-two-numeric-variables-with-decimal-places-tp4977855p5020512.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Adding two numeric variables with decimal places

Posted by ZK <st...@gmail.com>.
You probably noticed that doesn't work!!!

We need to convert the total back to a string:


double a= new Double((vars.get("adminfee")));
double b= new Double((vars.get("bbpfee")));
double x = (a+b);

vars.put("feeTotal",Double.toString(x));


print(a);
print(b);
print(x);



ZK

--
View this message in context: http://jmeter.512774.n5.nabble.com/Adding-two-numeric-variables-with-decimal-places-tp4977855p4978325.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Adding two numeric variables with decimal places

Posted by ZK <st...@gmail.com>.
Try something like this in a beanshell postprocessor:

double a= new Double((vars.get("adminfee")));
double b= new Double((vars.get("bbpfee")));
double x = (a+b);

vars.put("feeTotal",x)

print(a);
print(b);
print(x);


this would output the value to the variable ${feeTotal}


/(disclaimer: I am NOT a programmer)/ 



ZK

--
View this message in context: http://jmeter.512774.n5.nabble.com/Adding-two-numeric-variables-with-decimal-places-tp4977855p4978279.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org