Skip to content

Instantly share code, notes, and snippets.

@NotoriousBTC
Last active August 29, 2015 13:57
Show Gist options
  • Save NotoriousBTC/9635858 to your computer and use it in GitHub Desktop.
Save NotoriousBTC/9635858 to your computer and use it in GitHub Desktop.
Total BTC in Sell/Buy tables on Mintpal

Total BTC in Mintpal orderbooks

Only calculates/totals visible orders

  • In Chrome, open the Developer Tools (OSX shortcut: ⌥+⌘+I), and click on the "Console" section.
  • Clear the console by right clicking in the pane, and selecting 'Clear' at the bottom of the shortcut menu list
  • Copy/Paste the code below in to the console:
var total = 0;
$('#sellTable').find('td:last-child').each(function(){
  var cost = +$(this).text();
  total = total+cost;
});
console.log("Sell orders (visible) = " + total.toFixed(8) + " BTC");

var total = 0;
$('#buyTable').find('td:last-child').each(function(){
  var cost = +$(this).text();
  total = total+cost;
});
console.log("Buy orders (visible) = " + total.toFixed(8) + " BTC");

*Note: Because of how JavaScript handles decimal calculations, the count down to the satoshi (8 decimal place) may be slightly off. However, this does a decent job of providing a macro view

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment