Author Topic: Summary total round errors  (Read 304 times)

pbassey

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 36
    • View Profile
Summary total round errors
« on: January 19, 2023, 02:54:53 am »
I am using a grid with the following column definitions:

{title: "Total", width: 120, dataIndx: "OrigAmt", dataType: "float", format: '¥ ##,###.00', summary: {type: "sum" }},
{title: "% Share", width: 120, dataIndx: "pctToTotal", editable: false, dataType: "float", format: '##.00%', summary: {type: "sum" }},
{title: "Currency", width: 120, dataIndx: "Currency", editable: false, dataType: "float", format: '¥ ##,###.00', summary: {type: "sum" }},
{title: "Description / Reference", width: 250, dataIndx: "SAPDesc", dataType: "string"},             
{title: "USD", width: 100, dataIndx: "USD", dataType: "float", editable: false, format: '$ ##,###.00', summary: {type: "sum" }},
{title: "Total", width: 120, dataIndx: "totpayable", editable: false, dataType: "float", format: '¥ ##,###.00', summary: {type: "sum" }}


The Currency and last Total Columns should always match in terms of the values.  In many cases, the numbers do match, but there are a handful of Group totals in which there are rounding errors.

The Summary image is showing the rounding error.  The detail image sows the details numbers within the group which all match.

The last image shows the other summary totals that have rounding errors.

Thanks,
Peter
« Last Edit: January 19, 2023, 02:57:56 am by pbassey »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Summary total round errors
« Reply #1 on: January 19, 2023, 06:32:31 am »
can you please share a small test case on jsfiddle.