Skip to content

Commit 92c074d

Browse files
committed
add pct, fix alignment
1 parent 6d47683 commit 92c074d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

modules/command-util.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -240,24 +240,32 @@ module.exports = {
240240
const divisionLeadersMap = mapStandings(divisionLeaders);
241241
const wildcardMap = mapStandings(wildcard, true);
242242
const table = new AsciiTable(leagueName + ' Wild Card \n');
243-
table.setHeading('Team', 'W-L', 'WCGB', 'L10', 'STRK');
243+
table.setHeading('Team', 'W-L', 'PCT', 'WCGB', 'L10', 'STRK');
244+
table.setHeadingAlign(AsciiTable.CENTER);
245+
table.setAlign(1, AsciiTable.CENTER);
246+
table.setAlign(2, AsciiTable.CENTER);
247+
table.setAlign(3, AsciiTable.CENTER);
248+
table.setAlign(4, AsciiTable.CENTER);
249+
table.setAlign(5, AsciiTable.CENTER);
244250
divisionLeadersMap.forEach((entry) => table.addRow(
245251
entry.name,
246252
entry.wins + '-' + entry.losses,
253+
entry.pct,
247254
'-',
248255
entry.lastTen,
249256
entry.streak
250257
));
251258
let wildCardDivided = false;
252-
table.addRow('', '', '', '', '');
259+
table.addRow('', '', '', '', '', '');
253260
wildcardMap.forEach((entry) => {
254261
if (!wildCardDivided && entry.gamesBack !== '-' && !entry.gamesBack.includes('+')) {
255262
wildCardDivided = true;
256-
table.addRow('', '', '', '', '');
263+
table.addRow('', '', '', '', '', '');
257264
}
258265
table.addRow(
259266
entry.name,
260267
entry.wins + '-' + entry.losses,
268+
entry.pct,
261269
entry.gamesBack,
262270
entry.lastTen,
263271
entry.streak

0 commit comments

Comments
 (0)