[rules-users] eval question

2008-06-04 Thread Mike D

I'm close, but no cigar...

I have a header record amount and did an accumulate on a detail amount.  The
sum of the detail can be within a percent of the total.  

The $valueUsAmt is the header, and the totValue is the sum of lines...
What I need to do is to take the valueUsAmt * .0001 and if that is = the
abs value, all is good.

eval($valueUsAmt.subtract($totValue).abs().compareTo(???) = 0)

It's the * .0001 that is giving me the problem.  Any help would be
appreciated.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/eval-question-tp17647309p17647309.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] eval question

2008-06-04 Thread Marcus Ilgner
Hi Mike,

On Wed, Jun 4, 2008 at 3:53 PM, Mike D [EMAIL PROTECTED] wrote:

 I'm close, but no cigar...

 I have a header record amount and did an accumulate on a detail amount.  The
 sum of the detail can be within a percent of the total.

 The $valueUsAmt is the header, and the totValue is the sum of lines...
 What I need to do is to take the valueUsAmt * .0001 and if that is = the
 abs value, all is good.

 eval($valueUsAmt.subtract($totValue).abs().compareTo(???) = 0)

 It's the * .0001 that is giving me the problem.  Any help would be
 appreciated.

 Thanks!

Have you tried compareTo(new Float($valueUsAm*0.0001f)) ?
I'm not 100% percent sure if this is faster, but eventually you could even use
Number(intValue  0) from
$valueUsAmt.subtract($totValue).abs().compareTo(new
Float($valueUsAm*0.0001f))

Hope that helps
Marcus
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] eval question

2008-06-04 Thread Mike D

Thanks Marcus, but the multiplication is causing the rules to not get
deployed.  I'm going to try another workaround.  I'll let you know how it
goes.

Thanks again,
Mike
-- 
View this message in context: 
http://www.nabble.com/eval-question-tp17647309p17654649.html
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users