Skip to content

Instantly share code, notes, and snippets.

@joyeecheung
Created July 17, 2014 06:56
Show Gist options
  • Save joyeecheung/7edac8f72fa68164a0a1 to your computer and use it in GitHub Desktop.
Save joyeecheung/7edac8f72fa68164a0a1 to your computer and use it in GitHub Desktop.
GPA calculator for SYSU third party academic administration system
var tr = $("#score-result table tbody tr");
var credit_total = 0.0, total = 0.0;
tr.each(function(idx, row) {
var credit = parseFloat($(row).children('td')[0].textContent);
var score = parseFloat($(row).children('td')[2].textContent);
credit_total += credit;
total += score * credit;
});
console.log(total/credit_total);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment