Skip to content

Commit

Permalink
fix sci notation
Browse files Browse the repository at this point in the history
  • Loading branch information
spratt21 committed Jul 31, 2024
1 parent e328c3e commit 39f1817
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions dclm/leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ <h4 class="leader__title">Leaderboard</h4>
}

function populateTable(data, tableBody) {
const columnIndexForScientificNotation = 4; // Change this to the desired column index

data.forEach((rowData, rowIndex) => {
const row = document.createElement('tr');
Expand All @@ -465,10 +464,7 @@ <h4 class="leader__title">Leaderboard</h4>
const cell = document.createElement('td');

// Format the cell data for the specified column index
if (cellIndex === columnIndexForScientificNotation) {
const number = parseFloat(cellData);
cell.textContent = isNaN(number) ? cellData : number.toExponential(1);
} else if (cellIndex === 6 && cellData && cellData.trim() !== "") {
if (cellIndex === 6 && cellData && cellData.trim() !== "") {
const anchor = document.createElement('a');
anchor.href = cellData;
anchor.textContent = cellData;
Expand Down

0 comments on commit 39f1817

Please sign in to comment.