Created
August 12, 2016 00:42
-
-
Save nettofarah/50f4858b2457f1615381650033641576 to your computer and use it in GitHub Desktop.
Real Balance (Pending + Current) for Mint.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:void(function() { | |
var pending = jQuery('.pending').find('td:last'); | |
var values = Array.from(pending).map(td => jQuery(td).text().replace("$", "").replace("–", "-")); | |
values = values.filter(val => jQuery.trim(val)).map(parseFloat); | |
var pendingTotal = values.reduce((val, current) => val + current); | |
var currentTotalElement = jQuery('.account').first().find('.money').last(); | |
var currentTotal = parseFloat(currentTotalElement.text().replace("–", "-").replace("$", "")); | |
var realTotal = currentTotal + pendingTotal; | |
currentTotalElement.text(currentTotal + ' + ' + pendingTotal.toFixed(2) + ' = ' + realTotal.toFixed(2)); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment