Comparing within a range?

0 views
Skip to first unread message

Fu

unread,
Oct 9, 2007, 9:58:39 PM10/9/07
to OpenWFEru users
Is there a way for the hash value to be compared within a range. I
have tried to put the following in the csv table with no luck.

95..100,<=2.0,<=2.0,<=2,<=5,<=5,"output1"
90..94.99999,<=2.0,<=2.0,<=2,<=10,<=10,"output2"

>=95 && <100,<=2.0,<=2.0,<=2,<=5,<=5,"output1"
>=90 && <95,<=2.0,<=2.0,<=2,<=10,<=10,"output2"

My problem is that using the below hash gives the results "output4"
which is valid but not prefered. The "f1" needs to be within the
range.

decide({ "f1" => 92,
"f2" => 4.1,
"f3" => 0.9,
"f4" => 0.8,
"f5" => 5.1,
"f6" => 5.2
})

The original csv table I had is the following:

in:f1,in:f2,in:f3,in:f4,in:f5,in:f6,out:o

>=95,<=2.0,<=2.0,<=2,<=5,<=5,"output1"
>=90 & <95,<=2.0,<=2.0,<=2,<=10,<=10,"output2"
>=10 & <20,<=4.5,<=6.3,<=2,<=10,<=10,"output3"
>=10,<=4.5,<=6.3,<=2,<=10,<=10,"output4"

John Mettraux

unread,
Oct 9, 2007, 10:10:37 PM10/9/07
to openwfe...@googlegroups.com
On 10/10/07, Fu <fu.z...@gmail.com> wrote:
>
> Is there a way for the hash value to be compared within a range. I
> have tried to put the following in the csv table with no luck.
>
> 95..100,<=2.0,<=2.0,<=2,<=5,<=5,"output1"
> 90..94.99999,<=2.0,<=2.0,<=2,<=10,<=10,"output2"

Hello Fu,

Adding [Ruby] ranges to the CSV tables is a great idea !

Meanwhile, have you tried :

in:f0, in:f0
>90, <92

or something ?


Best regards,

--
John Mettraux -///- http://jmettraux.openwfe.org

Fu

unread,
Oct 9, 2007, 10:46:31 PM10/9/07
to OpenWFEru users
John,

Thank you very much for the response. Your idea worked great.

Fu

On Oct 9, 7:10 pm, "John Mettraux" <jmettr...@openwfe.org> wrote:

Reply all
Reply to author
Forward
0 new messages