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);
3438.3
trace("total Detail amt "+totalDetailAmt);
3351.89
trace("balance pmt "+balancePayment);
86.41000000000031
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.

This is an issue that comes up now and then here on this
forum. The rounding errors you're seeing are due to binary floating
point arithmetic. These errors aren't unique to ActionScript
(Flex/Flash). Consider using functions to correct the errors. Check
out Josh Tynjala's
blog.
TS

Similar Messages

  • In 2008 R2, I get Object doesn't support property or method PollResizeImages

    This is when I run a report from a reportviewer control to reporting services.  
    Another symptom is that images get cropped but if I refresh page cropping doesn't occur
    I have this version of SQL server 2008 R2
    Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)   Jun 17 2011 00:54:03   Copyright (c) Microsoft Corporation  Developer Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor) 
    I am using the ReportViewer control to display this report
    I get this error  Line: 1  Error: Object doesn't support property or method 'PollResizeImages'
    It appears to be from this method
    function anonymous()
    this.PollResizeImages(oReportDiv,oReportDiv)
    Another environment with same sql server version doesn't get this error for same report

    Hi DenisLang,
    As far as I know, it is a known issue in SSRS. Please try to install the latest version of the Report Viewer Runtime to fix the issue.
    If the issue is persist, I recommend you that submit this suggestion at
    https://connect.microsoft.com/SQLServer/ . If the suggestion mentioned by customers for many times, the product team may consider to add the feature in the next SQL Server version. Your feedback is valuable for us to improve our products and increase the
    level of service provided.
    Regards,
    Alisa Tang
    If you have any feedback on our support, please click
    here.
    Alisa Tang
    TechNet Community Support

  • Instantation Policy for Collection Object.

    Dear all,
    We hit the problem related to the collection object. We have extended the java's collection object, i.e. List, Set and Map, to hold some extra tranisent attributes and tried to recover them with event handler (i.e. postMerge, postClone, postBuild, postRefresh) during the object loading process. We also do not allow those extra attributes to be changed once they are set to not null by throwing exception.
    The interesting thing is that, we found the exception was thrown from postMerge/postClone event handler. It seems that TopLink were trying to reuse those cached collections in the memory once TopLink believed they would not be used anymore. Is my guess correct or not? And is there any "preBulid" event for "Collection" class, so that we can initialize the collection by ourself ?
    Thanks and regards,
    William

    William,
    I do all my extra wiring for custom collections in the get method for the elements. I use indirection, and just use the isinstantiated method to determine when it is getting created, and add some listeners for example.
    Hope that helps.
    Craig

  • Split a collection object

    Hi
    I have a collection object which is contains strings like (Name Address City State Country). The collection object is created from a result set. I am not sure how to parse into respective variable for the UI to display. As of now, I am just dumping the whole collection into a SINGLE textarea. The strings are NOT delimited.
    TIA

    Thanks for your response.
    To begin with I am a newbie. I have 5 columns from a table being returned by the java class as a collection. Once i get the collection which is made of variable
    (name, address city, country). I need to seggregate into respective text field in my UI.
    The following is what being returned from the result set.
    rs = ps.executeQuery();
              while (rs.next()){
                   String S_S1 = rs.getString("NAME");
                   String S_S2 = rs.getString("ADDRESS");
                   String S_S3 = rs.getString("CITY");
                   String S_S4 = rs.getString("COUNTRY");
                   Double S_D1 = new Double(rs.getDouble("FAXNO"));
                   String S_S5 = rs.getString("CMNTS");
    // HERE rv0 is declared as an object with these variables (if I could say so)
                   rv0 = new DBData(S_S1, S_S2, S_S3, S_S4, S_D1, S_S5);
    // rv is a collection, this class returns a collection
                   rv.add(rv0);
    The following is the what have after the data is retrieved
    DBGetConv dbg = new DBGetConv();
    Collection data = dbg.getData(UOMSLCT); // here getData is a method insde the class DBGetConv which returns the collection.
         Iterator iter = data.iterator();
    Now all have is an iterator which contains a few strings and a double, all i need is to parse those and load into their respective textareaS.
    HTH

  • How can we send a collection object to server?

    Hi All
    I am beginner in Flex. I have an assignment to do, plz help
    in this.
    How can we send a collection object to server?
    Means:
    I have a list of user details in a grid.
    And if i want to add a new User or edit a existing user
    details then i don’t want to send a request every time.
    Instead of i want to keep adding new User only in front side
    i.e. in the grid
    And finally i will send a single request with all the Users
    details.
    can it be possible ? If possible please help me.
    Thanks in advance

    Actually, the best way to do is using amfphp but since you
    are new to flex it might be a bit confusing if you dont know php.
    check here for amfphp:
    http://www.amfphp.org/
    you can also traverse through the arraycollection and create
    and xml. (this part is basic programming). Then you can send it to
    server using a post.
    For that think check the liveDocs for classes:
    HTTPService
    and
    URLLoader.

  • Time Machine doesn't add up

    I've been running Time Machine on a 250gb external drive since 2008. I don't back up my entire Macbook Pro hard drive, just a few particular folders of important projects. Yesterday this hard drive failed (no problem, nothing lost...). So I reformatted it, made it a Time Machine disk, and set it to the same folders I previously had. The total contents of these folders is about 100gb.
    I tell it to "Back Up Now" and it fails, telling me that it needs 350gb to do this backup and that I need to remove items. That's odd. So I remove one folder with 47gb, which brings the total to about 53gb. Back Up Now. This time it fails again, telling me that I need 430gb to complete this backup, and again, I need to remove items.
    So first, the math doesn't add up. These were the same folders that it's been backing up for three years. Second, by removing half of the material I want backed up, it made the estimated backup BIGGER. I can't seem to get around this.

    Wait wait wait, I think I see he problem. The list of folders on Time Machine is a list of things to EXCLUDE. Which is bizarre. It's been three years since I set it up and didn't realize that it assumes you want everything backed up unless told otherwise. Seems like the default should be to add what you want backed up, not choose things to not backup? Anyways. My error. Now I'm just waiting for it to tell me if I have enough room after jumping through the "back up this by not backing up that" hoops.

  • Convert Collection to Collection Object w/o warnings

    Hi,
    How to make conversion between Collection and Collection<Object>?
    // we have an unknown object obj which was dynamically instantiated with
    // reflection API: Class.forName( xxx ).newInstance()
    if ( Collection.class.isAssignableFrom( obj.getClass() ) ) {
      Collection col = (Collection) obj;
      readCollection( col );  // here we have a warning
        static void readCollection( Collection<Object> col) throws IOException
             int size = in.readInt();
             for ( int i = 0; i < size; i++ ) {
                  Object o = readObject();
                  col.add( o );
        }Anton

    Change :
    static void readCollection( Collection<Object> col) throws IOException
    To :
    static void readCollection( Collection<?> col) throws IOException
    Hope it helps,
    Daniel Campelo

  • Collect objects

    Are there any lists where can I add, collect objects? In java it is ArrayList.

    Take a look at ArrayCollection. Does this satisfy your requirements?
    http://livedocs.adobe.com/flex/3/langref/mx/collections/ArrayCollection.html
    Gk.

  • Error in allInOne.js: Object doesn't support this property or method

    We are having an issue deploy our website (Developed in .Net) on a specific server. When we try to visualize a report on any browser we get this error:
    Webpage error details
    User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; OfficeLiveConnector.1.4; OfficeLivePatch.0.0)
    Timestamp: Wed, 7 Apr 2010 17:52:31 UTC
    Message: Object doesn't support this property or method
    Line: 10
    Char: 281690
    Code: 0
    URI: http://{IP ADDRESS}/WebUserInterface/aspnet_client/system_web/2_0_50727/crystalreportviewers12/allInOne.js
    We have install the Crystal reports 2008 runtime and the Crystal report 2008 sp2.5 runtime. Both of them give me the same results.
    It's killing me because i have installed the same solution on many other server without any issue.
    Ben
    P.s. The Web server is  a Window Server 2003 R2 standard edition

    Perhaps using [modules|https://smpdl.sap-ag.de/~sapidp/012002523100006252802008E/modules.zip] will at least tell us what dlls are loading. Look at the CR dlls. There should not be any v11 files loaded by your app.
    You may also start considering obtaining phone support for this one. I have a feeling this will take more than just forums to solve...
    Phone support can be obtained here:
    http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300
    Ludek

  • Date object doesn't work in query filters

    I'm trying to create a universe object called Next Biweekly Pay End Date.  Some background: there is an end date for our biweekly payrolls every 14 days, and the logic behind the object is basically that if there was a biweekly pay end date 7 days ago, the next one is 7 days from today (that is, sysdate + 7), etc.</p>
    I have it working so that it displays the correct date when used in a WebI report.  However, when I use it in a query filter in a WebI report (like, Pay End Date = Next Biweekly Pay End Date), I don't get an error, but I also don't get any data.  Somehow my object doesn't work in a query filter.  The purpose of the object is for use in query filters, so I need to get this to work.</p>
    My best guess about why it doesn't work in a query filter is due to some issue with the data type.  Pay End Date has a data type of date in the universe.  I gave Next Biweekly Pay End Date a data type of date also, but the query filter still doesn't work; I get "no data to fetch."</p>
    We're using XI 3.1.6 and Oracle 10.  Any ideas about how to get this to work?</p>
    If it helps, here is the definition of Next Biweekly Pay End Date.  The logic is that it takes today's date, subtracts Oct. 31, 2009 (a biweekly pay end date), divides by 14, and looks at the remainder.  If the remainder is 0, then today is a pay end date and the next one is 14 days from now.  If the remainder is 1, yesterday was a pay end date and the next one is 13 days from now, etc.</p>
    case</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 0 then (sysdate + 14)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 1 then (sysdate + 13)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 2 then (sysdate + 12)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 3 then (sysdate + 11)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 4 then (sysdate + 10)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 5 then (sysdate + 9)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 6 then (sysdate + 8)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 7 then (sysdate + 7)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 8 then (sysdate + 6)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 9 then (sysdate + 5)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 10 then (sysdate + 4)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 11 then (sysdate + 3)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 12 then (sysdate + 2)</p>
      when mod((trunc(sysdate)) - (to_date('31/10/2009')),14) = 13 then (sysdate + 1)</p>
    end

    Thanks for the suggestions.
    I did some more testing, and there seems to be something more complicated going on.  I ran the following code in SQL*Plus:
    SELECT distinct M_PYDW1.PYSTATUS.DW_OWNER,
    case
    when to_date(sysdate, 'dd/mm/yyyy hh24:mi:ss') >= to_date('01/01/2010','dd/mm/yyyy hh24:mi:ss') then To_Date((sysdate - 2),'dd/mm/yyyy')
    else to_date(sysdate +2, 'dd/mm/yyyy')
    end
    FROM M_PYDW1.PYSTATUS
    The condition should be true, because the sysdate (today is Jan. 20) is greater than 1/1/2010, so I should get a result of sysdate - 2 (Jan. 18).  But the result I get is Jan. 22 (sysdate +2).  It seems that the comparison is failing even though I'm formatting both sysdate and 1/1/2010 as dates with a timestamp.  What could cause that?
    One more mystery: when I run the same code as above in a WebI report (using custom SQL), I get the error ORA-1830, date format picture ends before converting entire input string.

  • How do I get all the music on my IMAC in one folder. We have one IMAC and 3 sign ons. When add a song under one sign on it doesn't add to all 3 libraries.

    How do I get all the music on my IMAC in one ITUNES folder? We have one IMAC, with 3 sign ons for me and my 2 teens. When you add a song under one of the sign ons it doesn't add it to all 3 libraries. Before I updated to LION,  We had one main library with all the songs we bought, imported from cd's etc. Then any of the three of us could add it to our own IPOD instead of buying the song agin. It is one house, one IMAC. It was working fine under Leopard.

    The sort fields should generally be empty unless you've putting in custom values to sort solo artists by their surnames. You can apply common changes to thousands of tracks at once, just don't apply the wrong change because there is no undo.
    It is a good idea to backup before undertaking large scale changes. See this backup tip for a suggested approach.
    tt2
    Message was edited by: turingtest2

  • How do I delete an app from my phone but not the computer? Is there a way to deactivate it so it doesn't add it back when it syncs?

    How do I delete and app from my phone but not from the computer? Is there a way to do this so it doesn't add it back in when it syncs?

    In iTunes under the Apps tab for the iPhone device just uncheck any app you don't want synced to the phone. When you next sync the app will be removed from the phone but remain in the iTunes library.

  • ITunes doesn't add some of my music files.

    iTunes doesn't add to the library some of my files. For example, from the same album, iTunes just add few musics. With quick player, all files can be opened. How do I open all my music files in iTunes?  Thanks!

    iTunes doesn't add to the library some of my files.
    if those problem files are MP3's, try running them by MP3 Validator, then try adding them to iTunes.

  • Itunes doesn't add all the songs from my library

    Hi,
    Had to reinstall Itunes and now the program doesn't add all the songs from my library (roughly 4,000 songs). All that is added is maybe 20 songs, and always the same ones. It has worked perfectly before.
    I have tried to "pull" all the artist folders into the Itunes window, but it doesn't work. I have tried to set another folder as the Itunes library and then choose "add new folder", but only those 20 songs are added. I have made sure so that none of the files are copy protected or "read-only".
    Please, help!
    Best regards,
    Jonas

    Ok, I deleted the two files and upon startup iTunes did run that search wizard for music files. However, it only found 4 songs that are located on local harddisks, and did not (as far as I could see on the network status) even try to search on the network harddisk.
    One more thing though, that I forgot to mention before. I tried to solve this situation by installing an earlier version of iTunes... 4.6 i think, but when I tried to run the program it told me something like "Cannot read the file iTunes library.itl since it was created by a later version of iTunes". Where can i find that file, and should i remove it and try to add the songs with iTunes 4.6 instead?
    (Thanks so much for all your help!)

  • Windows 8.1 and IE11 - Critical Error: Object doesn't support property or method 'addEventListener'

    Our SharePoint 2010 sites don't work very well in Windows 8.1/IE11!!
    When opening list items or forms etc we get Critical Error : Object doesn't support property or method 'addEventListener'. It looks like it's possibly linked to InfoPath forms. Given that a large chunk of our users will probably be upgrading
    to Windows 8.1 as we speak this is slightly worrying!
    Has anyone else noticed this, or is it something to do with our deployment?  We're running SP2010 SP2 with latest CU.

    In older versions of IE, attachEvent is
    used to attach an event handler for some event on some element. But as per the update , starting with IE11, attachEvent is
    deprecated and you should use addEventListener instead.
    IE has included support for addEventListener from
    IE9 and above only. So if you still need to support IE8, I suggest you use some cross-browser library like jQuery to bind event handlers instead of vanilla javascript.
    As you're already using jQuery, you can bind events like below
    $('#yourElement').on('click', function(){
    // do something when you click on yourElement

Maybe you are looking for

  • Properly Disconnect my MacBook

    Hello, I recently bought a MacBook which I connect most of the time I use it to my external 27 inch monitor. I use a mini-display to DVI for this. But my question, is there a proper way to do this? Like should I first close my MacBook and then unplug

  • Modify TRIP

    Hi, I need to modify transaction TRIP: when I insert Expense Receipts, I'd like to convert Amount of Expense Receipt from current Currency to Advance one. I already have done the needed coding in user-exit EXIT_SAPMP56T_002 but it's called only at sa

  • Everyime i start itunes it crahses and i try to uninstall and it wont work

    i have my computer windows up to date and everytime i start i tunes my computer crashes and so tired to reinstall it but before i reinstall it i have to uninstall so i do that and while im uninstalling itunes i keep getting a secruity error it says l

  • How may i fill out a form on a scanned form saved in pdf format?

    how may i fill out a form on a scanned form saved in pdf format?

  • Can't uninstall XCelsius 2008 SP1, in order to install SP3.

    Hello, I'm attempting to uninstall XCelsius 2008 SP1 (FP3), in order to install SP3, as per the instructions.  However I am running into the same error message that is found in this thread: [SP3 Wont install because I can't get current version off|SP