jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Ide <flyingrhenqu...@gmail.com>
Subject Re: long\int Sum fuction
Date Tue, 03 May 2011 17:24:58 GMT
ints and longs don't do real numbers. I don't see a function to use floats,
which seems odd to me. I'm sure you could add up your numbers with a BSF
sampler, though. Something like

Float myFloat = ${varWithReals} // Or use
Float.parseFloat(vars.get("varWithReals"));
Float accumulate = ${accumulatorVar} + myFloat;
vars.put("accumulatorVar", Float.toString(accumulate));

It's kind of a long way to go to get that, though. Perhaps someone can
suggest an easier method.

You may prefer to use Double than Float, depending on how big/small your
numbers are.

-- 
Bruce Ide
FlyingRhenquest@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message