Buy Now
Sign in

How to set an interval for shortcode {rand:}

s.elena133 , May 29 at 06:37
S
s.elena133
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
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
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
S
s.elena133
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