Buy Now
Sign in

How to set an interval for shortcode {rand:}

s.elena133 , May 29 2018, 06:37
s.elena133 47
May 29 2018, 06:37 #377989
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.

GreyHead 64
May 29 2018, 08:34 #377992
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.
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
s.elena133 47
May 29 2018, 12:07 #378006
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