Use of randombool and std.atoi


#1

Hi,

I’m trying to use std.atoi to convert a string to a number, and then using this in randombool (which takes two integers).

For example:
set req.http.X-Percentage-Needed = “45”;
if ( randombool(std.atoi(req.http.X-Percentage-Needed),100) ) {
set req.http.X-Do-Random-Actions = “Y”;
}

When I do this, I get a compile error of:
Message from VCC-compiler:
Expected CNUM got ‘std.atoi’

How can I make randombool and std.atoi play nicely together?


#2

Hey Will,

This will be supported in a new release soon, but there’s currently no fixed ETA for said build.

Cheers,

Doc


#3

Hi Will,

Looks like this feature is live now.

Enjoy! Leon