1 Reply Latest reply on Apr 2, 2010 10:02 AM by philmodjunk

    Summary Field -- Totals not adding displayed decimals properly



      Summary Field -- Totals not adding displayed decimals properly


      I've got several Summary Fields where the (displayed) total does not add up the (displayed) subtotals correctly, due to undisplayed decimal places.


      For example, I have Subtotals A-F, which each display 2 decimal places (but in actually, due to what they are adding up, could be up to 4 decimal places behind the scenes.)

      Then I have the Total, which also displays only 2 decimal places.  This is occasionally a penny off, due to the unseen decimal places of the subtotals.


      What is the best way to solve this?  


      (My solution would be to create a secondary calc field for each subtotal.  Each calc field would pull the number from the summary field, then drop off the everything to the right of the first 2 decimal places.  Then my TOTAL field would add up these calc fields, instead of the actual summary fields.

      I'm just wondering if there's some built-in checkbox or something within FM that I can use.)

        • 1. Re: Summary Field -- Totals not adding displayed decimals properly

          You can use the Round function for this, but you should first consider whether this is truly what you want to do.


          If your individual values represent something like a scientific measurement or a calculation based on a scientific measurement, summarizing the unrounded value is generally the more accurate result. Each time you round a number you introduce a small "round off error" into your calculation and these errors can add up with each number that's part of your summary--which produces the difference you see.


          If the individual values are such that the extra decimal places are meaningless, (Dollar amounts less than one cent for example), then you should compute a rounded version and summarize it.