function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jerrymol VargheseJerrymol Varghese 

Opportunity RollUpSummary Field is having decimal values in Database but it shows Zero in UI

One of the opportunity rollup summary custom field of datatype currency is showing some decimal values like 0.000999... in database(means when we query it) but same rollup summary field is just showing a zero value in UI.
When we checked the formula behind this custom rollup summary field, it summing up all the opportunitylineitem's amount value which is again a custom field of datatype currency. And each product under this opportunity is just showing zero in backend and in UI.
Can you help us in understanding this behaviour of showing decimal values in rollup summary field?
This is impacting our day to day business as we have some logic in class which queries the same custom field and check whether it's value is zero, if it's zero do some action.But in backend since it is having some decimal values, if i look for zero value match it will never return any result.
Any help on this will be much appreciated.
 
ArvindyadavArvindyadav
hi Jerrymol,

as per my understanding you must have created the custom Number field with 2 or less decimal places, what it does is if you will enter a values like .00009 it will take only two decimal places and round off to zero. for an example if you have created a field with 2 decimal places and enter a valus .01 then it will save it as it is but if you'll enter a value .001 then it will save it as Zero.

Please try and let me know if it helped. 
Jerrymol VargheseJerrymol Varghese
hey Arvind,

I agree with you on rounding off.. but the rollup summary field on oppoty is calculated from a opportunity line item object.. When i check those opportunity line item's values that is just zero in back end and front end.
If that is zero how the sum of two zero can result in some decimals...