How to order numbers

hey guys im trying to sort an array of X and Y its basically resolutions i tried to go with getting the smallest X value and add it to another array but i came to realize that for example there are elements like : 1280 X 760 and 1280 X 768

any idea on how to order them ?

Store a struct of 2 integers instead of a string, and during comparison if the first members (X) are equal, then compare the Y members, and prioritize the smaller one.

I’m storing them at a struct of 2 int but the way I’m comparing it is that I’m putting the Xs in another array then i get the Min Value of that array and get the index of that Min Value from the Int struct and put it in new array then i remove that item from array of Xs

I don’t know to to compare the way you are saying , can you please show me in blueprint , just a demonstration please

So you made the structure ( I called it Resolution ). Then make a variable


You can populate the variable in the details:

Then to compare them. Here’s a function that takes an array of resolutions and finds the smallest ( it assumes the smallest is X * Y ):

and then the main graph would look like this:

This is probably not the most efficient way, but it works fine…