frean04

Jaspersoft 6.2.1: Rounding up numbers (BigDecimal) in reports

Discussion created by frean04 Employee on Nov 27, 2017
Latest reply on Nov 28, 2017 by Prashank Singh

I had been looking for a way to Round Up numbers in Jaspersoft (not through the query). Took me some time to figure it out, so i'll share it wth you.

 

But Jaspersoft (6.2.1) does not seem to offer such a function.

 

 

The trick is to add the following in the expression editor:

 

$F{MYFIELD}.setScale(0, BigDecimal.ROUND_HALF_UP)

 

That'll do the trick...

Outcomes