If you try the next bit, you get -0
<c:set var="demo" value="-0.04" />
<fmt:formatNumber maxFractionDigits="1" value="${demo}" var="demo" />
but if you check if less than 0 it says true
<c:if test="${demo < 0.00}">...</c:if>
How can I get around this? It does not seem to make sense, 0 is -0, I proved it in algebra ... In this post they point to the IEEE link, but still, I can not solve the problem
EDIT: Thanks for the comment, there is an error in the sample code. I assign a rounded value to a demo variable. And the output is not 0, but -0, I tried it
source
share