negative BigDecimal pattern returns wrong



I have a requirement to display currency(a BigDecimal) with parenthesis like this "(-#,##0.00)" when the respective amount is negative. I am able to achieve it by creating a conditional style and applying the dynamic pattern as "(-#,##0.00)" when necessary. However, the display shows me the value like this "-(-0.000,00)".

The value returned from the query it's already negative.

How can i get the result whit just de negative inside the parenthesis? like this "(-0.000,00)".

My condition in the propertie "Pattern EXP." for the field is :  $V{TOTAL_LIQ_UG}.compareTo(new BigDecimal(0))


lip_bahia's picture
Joined: May 7 2013 - 5:57am
Last seen: 4 years 1 month ago

1 Answer:



and don't use conditional style. It is not need in this simple case


sanbez's picture
Joined: Jan 11 2011 - 2:06am
Last seen: 1 hour 48 min ago

Thanks Man.

I have changed the way i was doing it and end up using the pattern propertie without the dynamic.

just had to change the type of my filed Class to BigDecimal and it worked.

lip_bahia - 4 years 3 months ago