negative BigDecimal pattern returns wrong

0

Hello,

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: 1 year 3 months ago

1 Answer:

1

Pattern: #,##0.00;(-#,##0.00)

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

 

sanbez's picture
409
Joined: Jan 11 2011 - 2:06am
Last seen: 3 days 20 hours 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 - 1 year 5 months ago
Feedback
randomness