How to find the biggest number in list?

Hi, I have a list which only has numbers.
I want to find what the biggest number in my list is.
How can I do that?

One way is to sort the list descending and get the first item. Check here Bubble Sort of ListView or Array - #ThunkableClassicTutorials - Thunkable Community You also can find there an extension doing that.
Other way is to pass one by one the list items with a loop and compare each one with a variable (with initial value 0). If is greater then keep the number in that variable. At the end of the loop, the variable should has the biggest number.

2 Likes

If your list length is same, you can use max block in Math category. Also you can do that for minimum by clicking dropdown on block.

Also AppyBuilder’s List extension is not working well for numbers. If you have (1, 2, 3, 4, 10, 11) in your list, then result will be:
1
10
11
2
3
4

So AppyBuilder’s extension is only for string lists. I think I will make a extension about lists. :wink:

https://puravidaapps.com/snippets.php#2max

/Boban

2 Likes