Compare java.math.BigDecimal values in JSTL
Hi,
I have 2 amounts , amt1 and amt2 which are java.math.BigDecimal, where i need to compare these amounts using JSTL in JSP , I have tried with both <c:when> and <c:if>
like
<c:if test="${! MyVO.amt1 == MyVO.amt2}"> or <c:if test="${! MyVO.amt1.compareTo(MyVO.amt2) == 0}">
// do this
</c:if>
<c:if test="${ MyVO.amt1 == MyVO.amt2}"> // else
// do this
</c:if>
It is giving me an error saying Cannot convert class java.math.BigDecimal to class java.lang.Boolean? How to overcome this problem?
Thanks.