Created
July 17, 2014 06:56
-
-
Save joyeecheung/7edac8f72fa68164a0a1 to your computer and use it in GitHub Desktop.
GPA calculator for SYSU third party academic administration system
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
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