Percentage system

implement a percentage system,
I’m creating an application for my mother, which takes all the values ​​and reports their percentages to know which was the most used

4 Likes

You can use the formula to calculate a percentage to get it, but I agree with you, we have other math functions, it’s weird to not have that one.

I don’t know if you’re familiar with the array tools extension. If it doesn’t have what you need then it would be a good place for the added functions.

https://wiki.gdevelop.io/gdevelop5/extensions/array-tools/#array-tools

You just need to count the number of times each value is used, and compare it to the total count.

To get the ratio just do count divided by total. So if there are ten entries total and five of them are the same, you would be doing 5/10 or 0.5

To convert this to percentage just multiply by 100. 0.5 * 100 = 50%