26
Views
1
Comments
Random Picker with percent

Hello!

I'm trying to create a random picker with percentage, but I can't figure out how to do it, for example:

Total = 10

A = 3
B = 5
C = 2

That A, B and C have proportional X% of them coming out, with B being the most likely. I am currently using a plugin from Forge (Randomizer Number Generator) but would like to be able to use something similar with percentage

UserImage.jpg
vikas sharma
Champion
I think for this you can write some logic in little different way if it works for your business logic. Like total is 10. So pick A random number from range 1 to 6 (example) Then B will be some X% of A and C will be Y% of A. or C can be 10-A-B. By this way you can achieve three different value for A,B and C. Regards
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.