Jump to content
We've recently updated our Privacy Statement, available here ×

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


mansi.acharya
Go to solution Solved by bobtins,

Recommended Posts

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.

TIBCOJaspersoftAdHocEditor(1).png.191c1f1360eed6c05a16c38648a79da6.png

 

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

222.png.4f6bd5de68fab0ae635b707e60c4ccf3.png

Kindly help.

 

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted Images

  • Solution

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. 

stuff.PNG.1bc0aff8e6947923e4a8c64b682fd34b.PNG

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.00ADH_100_MASK_dec_1 = 0ADH_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

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...