Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Why array is not finding four digit value when using array.max() function?

Tirupathirayudu Yarlagadda
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 29, 2019

here is my code

def  s = vars.get("response");

s.max();

here in the above the function max() is able to find the maximum value in 3 digit but it is not finding the four digit value why?

1 answer

0 votes
Ilya Turov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 29, 2019

could it be that all elements in s array are strings?

so your max value is max lexigraphic value

try (if you are sure all the elements you are getting are numbers)

s.max {it.toFloat()}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Upcoming Apps & Integrations Events