From fe9a9a916ca6a7aad05db53d21dc68f5fdc30abf Mon Sep 17 00:00:00 2001 From: Le Beier Date: Sun, 7 Jul 2019 21:36:39 +0800 Subject: [PATCH] fixed the row number format for `leetcode stat -g` --- lib/commands/stat.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/commands/stat.js b/lib/commands/stat.js index 3c51ab98..772499c4 100644 --- a/lib/commands/stat.js +++ b/lib/commands/stat.js @@ -104,7 +104,8 @@ function showGraph(problems) { for (let problem of problems) graph[problem.fid] = ICONS[problem.state] || ICONS.none; - let line = [sprintf(' %03s', 0)]; + let rowNumFormat = ' %04s'; + let line = [sprintf(rowNumFormat, 0)]; for (let i = 1, n = graph.length; i <= n; ++i) { // padding before group if (i % 10 === 1) line.push(' '); @@ -114,7 +115,7 @@ function showGraph(problems) { // time to start new row if (i % (10 * groups) === 0 || i === n) { log.info(line.join(' ')); - line = [sprintf(' %03s', i)]; + line = [sprintf(rowNumFormat, i)]; } }