Fair Finance Guide International - Total scores
console.clear();
var iCount, iCounter, iRows, iTotal, sBank, sResult, aScores = [];
/* Calculate scores */
iCount = $('table.scores-container thead td').length;
for (iCounter = 1; iCounter <= iCount; iCounter++) {
sBank = '';
iTotal = 0;
iRows = 0;
$('table td:nth-of-type(' + iCounter + ')').each(function (i, o) {
var iScore, sScore;
sScore = $(o).find('a').attr('class').substr(6, 2);
iScore = parseInt(sScore);
if (isNaN(iScore) === false) {
if (iScore > 0) {
iTotal += iScore;
iRows++;
}
} else {
sBank = $(o).find('[data-bind="text: name"]').text().trim();
}
});
aScores.push({
name: sBank,
score: (iTotal / iRows).toFixed(2)
});
}
/* Sort by score */
aScores.sort(function (a, b) {
return b.score - a.score;
});
/* Create output */
sResult = '';
aScores.forEach(function (p_oScore) {
sResult += p_oScore.name + ': ' + p_oScore.score + "\n";
});
console.log(sResult);
/*EOF*/
Fair Finance Guide International (FFGI) is an international civil society network initiated by Oxfam, that seeks to strengthen the commitment of banks and other financial institutions to social, environmental and human rights standards.
Every year, the FFGI publishes records of how financial institutions perform on a set of subjects.
For the Netherlands these results are published at https://eerlijkegeldwijzer.nl/
The website shows the scores for each company per subject but does not show a total.
The javascript file calculate-total-scores.js
has logic to calculate these scores.
The result can be seen in the eerlijkegeldwijzer-scores-2017.md
files.