I would probably suggest you use a groovy script to do this. You can use
Java syntax in groovy and you will have access to more powerful functions
related to strings and dates.
https://jmetervn.com/2016/12/05/jsr223-with-groovy-variables-part-1/
This way you can use parse int and get the integer values to subtract from.
Or you could create date objects and use the date class to perform the
subtraction.

On Thu, Oct 1, 2020 at 9:25 AM Krister Nilsson <
[email protected]> wrote:

> Hi!
>
> I have tried many things but I come to the conclusion that Jmeter's
> Javascript behaves a bit differently at least compared to the console in
> Chrome. Can you please help me out?
>
> I want to do something like this
>
> ${__time(yyyy,)}-"1953"
>
> or simplified
>
> 2020-"1953"
>
> (It does perhaps look a little bit weird but there is a reason why the
> second term should be a string.)
>
> Now I need to get an integer returned but with Jmeter I get 67.0 instead
> of 67. I have tried parseInt() but it has no effect.
>
> Anyone who can help me?
>
> Med vänlig hälsning
> Krister Nilsson
> ____________________________________________________________
>
> Krister Nilsson / översteprest, prestandatest
>
> IT Fond konto och teknisk plattform
> Telefon direkt 010-454 21 97, mobil 072-210 21 97
> [email protected]<mailto:
> [email protected]>
>
> Pensionsmyndigheten,
> Telefon vxl 0771-771 771, fax 08-658 13 00, www.pensionsmyndigheten.se<
> http://www.pensionsmyndigheten.se/>
>
>
> P Överväg miljöpåverkan innan du skriver ut detta e-brev.
>
>

-- 
Thanks,
Brian Wolfe
https://www.linkedin.com/in/brian-wolfe-3136425a/

Reply via email to