Why does Calculated Field round of the values to 2 decimals by default?

0

Hello all.

I am creating an ad-hoc view from Jaspersoft server. I have selected fields from a domain and now I am trying to create a calculated field from the ad-hoc view.

My calculation requires dividing a field value by 86400 and i want the exact decimal value. But when I display it as columns, it always rounds off to 2 digits. I do not want to round it off. Below is the screenshot of how I add the calculated field. The Summary Calculation is set to none.

 

Why does it give the only limited data formats? I need more decimal values.

Kindly help.

 

 

mansi.acharya's picture
Joined: Feb 17 2015 - 8:02pm
Last seen: 1 year 10 months ago

1 Answer:

1

Actually, the very last formatting option, which just shows three places, will actually show from three to sixteen, but the number used as an example only has two decimal places. 

Extra decimal places in Ad Hoc

Here are some more details if the provided formats are not enough:

You can do further configuration of formatting in Ad Hoc by modifying the file WEB-INF/bundles/adhoc_masks.properties.

Here are the formats for decimal types:

ADH_100_MASK_dec_0 = #,##0.00
ADH_100_MASK_dec_1 = 0
ADH_100_MASK_dec_2 = $#,##0.00;($#,##0.00)
ADH_100_MASK_dec_3 = $#,##0;($#,##0)
ADH_100_MASK_dec_4 = $#,##0.000#############

Decimal formats are specified by the Java DecimalFormat class; here's some documentation:

https://docs.oracle.com/javase/tutorial/i18n/format/decimalFormat.html

bobtins's picture
172
Joined: Aug 17 2006 - 5:03pm
Last seen: 1 month 2 weeks ago
Feedback