3 Replies Latest reply on Aug 5, 2008 7:37 AM by WildSpidee

    Math on Collection Objects Doesn't Add Up

      I am populating a datagrid with a collection and adding the amounts in one column to return a total at the bottom and then performing simple math on the total. The function to loop and add is shown.

      The variables are declared in another place in my code as [Bindable] public var Variable:Number
      Here are the results of the traces -
      trace(parentDocument.glTransSetRecords .detail_amt
      Returns each detail_amt on each record. There are 18 results but only four are not zero, which are: 2966.49,
      56.4, 204.57, 124.43
      trace("abs trans "+absTransAmt);
      trace("total Detail amt "+totalDetailAmt);
      trace("balance pmt "+balancePayment);

      I have a validation function that runs on this balancePayment that obviously doesn't work because of these weird results. Does anyone know where Flex is getting these amounts? The application is accounting focused and I can't have a system that can't add properly. Any suggestions would be appreciated.