Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbloom7/293990 to your computer and use it in GitHub Desktop.
Save chrisbloom7/293990 to your computer and use it in GitHub Desktop.
Bookmarklet to calculate the sum of selected numbers in a table
javascript:void(prompt('Result',function(){var a=window.getSelection().toString();if(a.indexOf("\n")>=0){a=a.split("\n");var b=0;for(var i=0;i<a.length;i++){b+=parseFloat(a[i])}}else b=parseFloat(a);return(isNaN(b))?0:b}()));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment