Skip to content

Commit

Permalink
Swap total ratings for max score
Browse files Browse the repository at this point in the history
  • Loading branch information
andylolz committed Jun 13, 2024
1 parent 5de5a68 commit d45bb44
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions output/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Proposed [Twitter (X) community notes](https://x.com/i/communitynotes/download-d
<th>Tweet status</th>
<th>Tweet author</th>
<th>Tweet content</th>
<th>Ratings total</th>
<th>Max score</th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -237,16 +237,7 @@ Proposed [Twitter (X) community notes](https://x.com/i/communitynotes/download-d
visible: true,
defaultContent: 0,
render: function (data, type, row, meta) {
let totalRating = 0;
for (let i = 0; i < data.length; i++) {
if (data[i]['ratings']) {
totalRating = totalRating + data[i]['ratings'];
}
}
if (type === 'display') {
return totalRating.toLocaleString();
}
return totalRating;
return data[0]['score'];
}
}
],
Expand Down

0 comments on commit d45bb44

Please sign in to comment.