ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Rounding and Display of Numeric Attributes


Article ID: 17679


Updated On:


Clarity PPM SaaS Clarity PPM On Premise



When an Attribute (Numeric, 2 Decimal Places) Field is Set to Show Only 1 Decimal Place in the View & an Even Number is Entered into the 1st Decimal Place Followed by a 5 in the 2nd Decimal Place & Saved, Rounds Incorrectly

Steps to Reproduce:

  1. Login as Administrator
  2. Go to the Project Object
  3. Create a new attribute with Data Type = Number and Decimal Places = 2
  4. Go to the Application Side, and click on Projects
  5. Select the Configure Icon
  6. Move the attribute 'Num Test' from the Available Column to the Selected Column
  7. Save
  8. Click the List Column Section drop down, and select Fields
  9. Click on the Properties Icon for 'Num Test'
  10. Change Decimal Places to 1
  11. Save and Return to the Project List
  12. Now go back and perform an inline edit of the new 'Num Test' field to see the rounding correctly performed by entering 1.15 (note first place of the decimal is an odd number)
  13. Save
    See that the resulting number rounded up correctly to 1.2, as you would expect
  14. Now perform an in-line edit of the new 'Num Test' field to see the field round incorrectly by entering 1.25 (note first place of decimal is an even number):
  15. Save
    See that the resulting number rounded down incorrectly to 1.2 instead of 1.3 as you would expect 

Expected Result: .25 or any whole number with .25 displays as .3
Actual Result: .25 or any whole number with .25 displays as .2


In general, we use the default Java rounding method which is called ROUND_HALF_EVEN is explained here.

Some examples here:

So .25 will round down while .35 will round up.



Release: ESPCLA99000-13.2-Clarity-Extended Support Plus