How to set an interval for shortcode {rand:}

cambium 29 May, 2018
Hello!
Is possible to set an interval for {rand:}? ( i need a number in interval from 0 to 9 only)
If it is, give an example, please.

Thanks
GreyHead 29 May, 2018
1 Likes
Hi s.elena133,

I don't think that there is any way to set that for {rand;} - you could trim the result down to just the first digit. But probably simpler to use a PHP action with the rand() method - see here.

Bob
cambium 29 May, 2018
Hi Bob,
I thought about the trim method, but if it would be the number for 1..20, for example, then be needed the interval.
It's a pity that there is no such possibility with {rand:}. It would be very convenient
In some cases php more useful of course.

Many many thanks
This topic is locked and no more replies can be posted.