JQuery loop to sum columns across Views attachments counts last rows twice

I’m using JQuery in D7 to sum columns in a View page with multiple View attachments. The usual Views module summing solutions, such as Aggregator Plus, Views Summary, ViewsCalc don’t work across attached views. Everything works great except for some baffling reason it’s counting the last row value twice. Can’t figure out why. I’ve tried different Views table types, all do the same. Can’t see any second value on the page or in DOM elements, hidden or otherwise.

The code to sum the values:

    yourString = jQuery(this).text();
     if ( !isNaN(parseFloat(yourString.replace(/[^0-9-.]/g, '')))){
    yourNumber = parseFloat(yourString.replace(/[^0-9-.]/g, ''));
    sumYours += yourNumber;
    return sumYours;

sumYours returns the total, but if there’s any value in the last row of any attachment in the view it gets counted twice, messing up the math. The above code steps over header text (which gives NaN) and converts the currency strings to a float to add them.

The Views last row does have a separate CSS class views-row-last, maybe I can check for that (not sure yet how) but this seems like a hack to mask some other issue.


Drupal version: 

Source: https://www.drupal.org/taxonomy/term/4/feed