One Star

How to compare value of BigDecimal with a integer in tMap

Hello,
Please teach me!
What i wanna do is following.
When creating comparison sentence in Expression Builder
for compare both values.
Then this error has occur and displayed massage like
it is different type of value that Bigdecimal and Integer.
comparison sentence i wrote is following.
/row1.amount != 0
row1.amount is Bigdecimal.
How can I compare these values?
Thanks!
Regards,
4 REPLIES
Six Stars

Re: How to compare value of BigDecimal with a integer in tMap

tak a look at java documentation.
One Star

Re: How to compare value of BigDecimal with a integer in tMap

Hi,
row1.amount!=new BigDecimal(0). But you should the syntaxe row1.amount.compareTo(new BigDecimal(0))? new BigDecimal(0) (it s equal) : (not equal)
One Star

Re: How to compare value of BigDecimal with a integer in tMap

Hi,
I don't know what you exactly want to do, but you can also write like below...
row1.amount != BigDecimal.valueOf(0)
So, if you use it in expression builder, you probably would like to make a logical comprasion. for that;
row1.amount != BigDecimal.valueOf(0) ? do x : do y
One Star

Re: How to compare value of BigDecimal with a integer in tMap

First convert BigDecimal tparam to integer in Expression Builder.
For Example : row1.ID.intValue() >= 2? "Y" : "N";