Skip to main content

Hello everyone,

I'm working on a Salesforce implementation where users enter weight and purity values, and a Formula Field calculates the final estimated value.

The calculation works correctly on the record page, but I've noticed that some report exports show slightly different decimal values after rounding. The difference is very small, but it becomes noticeable when processing a large number of records.

To validate the expected result, I compared several test cases with an external gold rate calculator, and most values match, but a few records differ by a small decimal amount.

Currently, the calculation uses Formula Fields and Number fields with fixed decimal precision.

I'm trying to understand:

  •  Whether Salesforce applies additional rounding during report generation. 
  •  If Formula Fields and Reports handle decimal precision differently. 
  •  Whether moving the calculation to Flow or Apex would provide more consistent results. 

Has anyone encountered similar rounding behavior when working with calculated numeric values in Salesforce reports?

Any recommendations or best practices would be greatly appreciated.

Thank you.    @* Salesforce Developers * 

1 resposta
  1. 11 de ago., 16:45

    Hey, 

     

    This is usually not extra rounding by reports; it's precision stored vs precision displayed. 

     

    Formula fields calculate internally with much higher precision than what you set in decimal places. The record page and report just display the rounded result, but if that formula field is referenced again (in another formula, rollup, or report aggregate), Salesforce sometimes recalculates using stored precision instead of the displayed rounded value. That's where the small mismatch comes from. 

     

    A few things to check: 

    - Confirm decimal places set on the Formula field and on any Number fields feeding it. 

    - If you're aggregating (sum/avg) in the report, aggregation happens on stored values, not displayed ones. 

    - ROUND() function in the formula (rounds half-up) will give consistent results, safer than relying on field-level decimal display. 

     

    Moving to Flow or Apex won't fix this by itself, same rounding rules apply. What actually helps is wrapping your formula in ROUND(yourFormula, 2) so the value itself is rounded, not just displayed. 

     

    Reference:

    https://help.salesforce.com/s/articleView?id=000385689&type=1

0/9000