Last active
January 1, 2016 08:19
-
-
Save yoni/8117355 to your computer and use it in GitHub Desktop.
On Lending Club, the aftermarket (i.e. FolioFn) trading form entry is pretty horrible. This little script allows you to set a discount amount (e.g. 90%) and apply it to all loans' asking prices.
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
var discount = 0.9; // set this to your own discount policy | |
var outstanding = document.getElementsByClassName('outstanding-principal-accrued-interest'); | |
var askingPrices = document.getElementsByClassName('asking-price'); | |
Array.prototype.slice.call(outstanding).forEach( | |
function(entry, i) { | |
var outstandingAmount = entry.textContent.replace(/[$]/g, ""); | |
var askingPrice = (outstandingAmount * discount).toFixed(2); | |
askingPrices[i].value = askingPrice; | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment