2006 IR Open Dicussion Posted September 5, 2006 Share Posted September 5, 2006 By: AllRightyThen - mbruner_earj Compare Double to Integer 2006-03-07 11:48 I have two filds I would like to compare. One is a calculated Double value. I would like to ROUND this value to a whole number. Then I have an Integer value I would like to compare that to. If I use a mask, no rounding occurs and the comparison is wrong. If I do new Integer($F{DOUBLEFIELD} != $F{INTEGERFIELD}, the double field gets truncated instead of rounded. How do I round that value? Thanks. Michael By: cardondenis - cardondenis RE: Compare Double to Integer 2006-03-07 12:20 Hi, something like : ((int) Math.round($F{mydouble}.doubleValue())) == $F{myint}.intval() ? "true" : "false" should do it. Perhaps groovy would also help. Cheers, Denis Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now