Forum Academy Marketplace Showcase Pricing Features

Generate a random number within a range

Hi,
How can I generate random numbers within a range (example: generate random numbers from 1 to 10)?

Thanks

Hey there @fcastillosa.apps,

Check out this plugin by @AirDev.

1 Like

Hi there, @fcastillosa.apps… if you don’t want to go the plugin route (nothing wrong with that, of course), you could give something like this a try…

Best…
Mike

2 Likes

thanks

Thanks Mike, so what should I put after converted to number? I mean, where do I set the numeric range?

In this case, the range is handled by the length of characters. The example I am showing will only ever return one digit, so you will get a random number between 0 and 9. If you made the length of characters 2, you would get a random number between 0 and 99.

1 Like

Oh ok, got it. Thanks

1 Like