Created
February 27, 2014 19:56
-
-
Save sgreenfield/9258154 to your computer and use it in GitHub Desktop.
Coinbase Average Price Calculator Bookmarklet
This file contains 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:(function()%7Bvar%20%24rows%3D%24('%23transfers_list%20tr%3Agt(0)')%2Corders%3D%5B%5D%2CtotalQuantity%3D0%2CtotalPrice%3D0%3B%24rows.each(function()%7Bvar%20a%3D%24.trim(%24(this).find('td%3Aeq(5)').text()).split('%20')%5B0%5D*1%2Cquantity%3D%24.trim(%24(this).find('td%3Aeq(3)').text()).split('%20')%5B0%5D*1%3Borders.push(%7Bquantity%3Aquantity%2Crate%3Aa%7D)%7D)%3B%24.each(orders%2Cfunction(i%2Ca)%7Bvar%20b%3Da.rate*a.quantity%3BtotalQuantity%2B%3Da.quantity%3BtotalPrice%2B%3Db%7D)%3Balert('paid%20average%20of%3A%20'%2B(totalPrice%2FtotalQuantity)%2B'%20for%20'%2BtotalQuantity)%7D)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment